#P1911. CostEstimation

CostEstimation

        Define S is a set {1,2,3,4...k}.

Define function

                           

Define the cost of f(S) is the minimum call times of f() when you get it.

        If we have called f(S) before , we can cost 0 to get f(S) directly after that.

Please calculate the cost of f(S)  . (mod 109+7)


Input

First a integer T,
then T lines follow ,every line has one positive integer k.(1 <= k <= 1000).

Output

For T test cases, each with a number -- the min cost to calculate the f(S).(mod 1000000007)

Sample Input

2
2
3

Sample Output

5
19

HINT

</p>

For first test case ,the cost of f({1,2}) is 5
f({1,2}) = f(Ø) + f({1}) + f({2})
f({2}) = f{Ø}
f({1}) = f{Ø}
so the cost of f({1,2}) is 5

Source