#C2682. Factorial Modulo Computation
Factorial Modulo Computation
Factorial Modulo Computation
You are given a non-negative integer \( n \). Your task is to compute \( n! \) (the factorial of \( n \)) modulo \(10^9+7\). The factorial of \( n \) is defined as:
[ n! = \begin{cases} 1, & \text{if } n = 0 \ 1 \times 2 \times \cdots \times n, & \text{if } n \geq 1 \end{cases} ]
Since \( n! \) can grow very fast, report the answer modulo \(10^9+7\). For example, if \( n = 5 \), then \( 5! = 120 \), and since 120 is less than \(10^9+7\), the answer is 120.
inputFormat
The input consists of a single line containing one non-negative integer \( n \) where \(0 \leq n \leq 10^5\).
outputFormat
Output a single integer: the value of \( n! \) modulo \(10^9+7\).
## sample0
1