Chef is solving mathematics problems. He is preparing for Engineering Entrance exam. He's stuck in a problem.
$f(n)=1^n*2^{n-1}*3^{n-2} * \ldots * n^{1} $ 
Help Chef to find the value of $f(n)$.Since this number could be very large, compute it modulo $1000000007$.
-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains of a single line of input,  $N$. 
-----Output:-----
For each testcase, output in a single line the value of $f(n)$ mod $1000000007$.
-----Constraints-----
- $1 \leq T \leq 10^6$
- $1 \leq N \leq 10^6$
-----Subtasks-----
Subtask 1(24 points) : 
- $1 \leq T \leq 5000$
- $1 \leq N \leq 5000$
Subtask 2(51 points) : original constraints
-----Sample Input:-----
1
3
-----Sample Output:-----
12
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

M = 10**9+7
f = [1]*(1000001)
for i in range(2,1000001):
 f[i] = (i*f[i-1])%M
for i in range(2,1000001):
 f[i] = (f[i]*f[i-1])%M

for _ in range(inp()):
 n = inp()
 print(f[n])
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

M = 10**9+7
f = [1]*(1000001)
for i in range(2,1000001):
 f[i] = (i*f[i-1])%M
for i in range(2,1000001):
 f[i] = (f[i]*f[i-1])%M

for _ in range(inp()):
 n = inp()
 print(f[n])