Chef is good at making pancakes. Generally he gets requests to serve N pancakes at once.
He serves them in the form of a stack.
A pancake can be treated as a circular disk with some radius.

Chef needs to take care that when he places a pancake on the top of the stack the radius of the pancake should not exceed the radius of the largest pancake in the stack by more than 1. 
Additionally all radii should be positive integers, and the bottom most pancake should have its radius as 1.
Chef wants you to find out in how many ways can he create a stack containing N pancakes.

------ Input Format ------ 

First line of the input contains T (T ≤ 1000) denoting the number of test cases.

T lines follow each containing a single integer N (1 ≤ N ≤ 1000) denoting the size of the required stack.

------ Output Format ------ 

For each case the output should be a single integer representing the number of ways a stack of size N can be created. As the answer can be large print it modulo 1000000007.

----- Sample Input 1 ------ 
2
1
2
----- Sample Output 1 ------ 
1
2

Difficulty: MEDIUM_HARD

Solutions:
MD = 1000000007
P = [[0 for x in range(1001)] for y in range(1001)]
P[1][1] = 1
for n in range(2, 1001):
	for w in range(1, n + 1):
		P[n][w] = (P[n - 1][w - 1] + w * P[n - 1][w]) % MD
t = int(input())
for i in range(t):
	N = int(input())
	tot = 0
	for w in range(1, N + 1):
		tot += P[N][w]
	r = tot % MD
	print(r)