# Primes, the Permutation & Everything !

Playing with numbers and data is a whole lot fun . I love scribbling my pages and brains with crap ,

a whole lot of crap . So , is this question and idea . I've been playing with Prime numbers and permutations ,

and I'm keen on certain kinds of permutations . Say , for a given number N , I started building

up permutations of numbers from 1 to N , such that the i-th integer in this permutation is the j-th

smallest number from 1 till i , where j is { 1 , prime number } .

Indexing is 1-based .

Example , say N = 3

a valid permutation is 1 , 3 , 2

**Input**

Number of test cases T , followed by T lines of a single number N

4

1

2

3

4

**Output**

Number of such permutations modulo 10^9 + 7 , followed by a new line

1

2

6

18

**Constraints :**

T <= 10^6

1 <= N <= 10^6

*Problem Setter : Akshit Poddar*

**Languages:**Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Ruby,Text