Formula

Time Limit: 2000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 5139
64-bit integer IO format: %I64d      Java class name: Main

Description

$f(n) = (\prod\limits_{i=1}^{n}i^{n-i+1})\%1000000007$
You are expected to write a program to calculate f(n) when a certain n is given.

Input

Multi test cases (about 100000), every case contains an integer n in a single line.
Please process to the end of file.

[Technical Specification]
$1 \leq n \leq 10000000$

Output

For each n,output f(n) in a single line.

Sample Input

2
100

Sample Output

2
148277692

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .