#include<bits/stdc++.h>
#define M 100000007
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
long long int i,t,n;
long long int store[500001];
store[0]=1;
store[1]=1;
for(i=2;i<500001;i++)
{
store[i]=((store[i-2]%M)+(store[i-1]%M))%M;
}
cin>>t;
while(t--)
{
cin>>n;
cout<<store[n-1]<<"\n";
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSAgTSAxMDAwMDAwMDcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewoJaW9zOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwogICAgY2luLnRpZShOVUxMKTsKICAgIGxvbmcgbG9uZyBpbnQgaSx0LG47CiBsb25nIGxvbmcgaW50IHN0b3JlWzUwMDAwMV07CiBzdG9yZVswXT0xOwogc3RvcmVbMV09MTsKIGZvcihpPTI7aTw1MDAwMDE7aSsrKQogewogCXN0b3JlW2ldPSgoc3RvcmVbaS0yXSVNKSsoc3RvcmVbaS0xXSVNKSklTTsKIH0KIGNpbj4+dDsKIHdoaWxlKHQtLSkKIHsKIAljaW4+Pm47CiAJY291dDw8c3RvcmVbbi0xXTw8IlxuIjsKIH0KICAgIHJldHVybiAwOwp9