n-objects

You will be given a number n- number of distinguishable objects. Your task is to calculate the number of ways that n objects can be grouped into sets if no set can be empty.
For example, the letters AB can be grouped into following sets- {(AB)} and {(A), (B)}. Thus, for n=2 the answer is 2.

Another eg:-  the letters can be ABC can be grouped into following sets- 
{ (ABC) }, 
{ (AB) , (C) }, 
{ (AC) , (B) }, 
{ (BC) , (A) }, 
{ (A) , (B) , (C)}. 

Thus the answer is 5.

Since the answer could be very large, output it modulo 1000000007.

Input : 
The first line of the input contains an integer T (1 ≤ T ≤ 500), the number of test cases. Then T test cases follow. Each test case consists of a line which contains a positive integer, n (1 ≤ n ≤ 500). 

Output :
Output the answer as per the constraints given in the problem statement.

SAMPLE INPUT
3
1
2
3

SAMPLE OUTPUT
1
2
5

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: