#K54022. Valid Cookie Distributions
Valid Cookie Distributions
Valid Cookie Distributions
Given an integer \(n\), you are required to compute the number of valid distributions of \(n\) types of cookies. In each valid distribution, the cookies are arranged in a sequence such that adjacent recipients get different types, which, as it turns out, leads to the result being \(n!\) (n factorial). Since the answer can be very large, output the result modulo \(10^9+7\).
Note: When \(n = 1\), the distribution count is \(1\); when \(n = 2\), it is \(2\); when \(n = 3\), it becomes \(6\); and so on.
You are expected to read the input from standard input (stdin) and write the result to standard output (stdout).
inputFormat
The input consists of a single integer:
n
(\(1 \le n \le 10^5\)): the number of different types of cookies.
The integer is provided via standard input.
outputFormat
Output a single integer, the value of \(n!\) modulo \(10^9+7\), to standard output.
## sample1
1