#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int t;
cin >> t;
int mod = 1000000007;
long long int* m = new long long[1000000 + 2];
m[1] = 1;
m[2] = 2;
for (int i = 3; i <= 1e6; i++) {
m[i] = (m[i - 1] + m[i - 2]) % mod;
}
while (t > 0)
{
int n;
cin >> n;
cout << m[n] % mod << endl;
t--;
}
delete[] m;
}