Help required SPOJ.com problem

Can anybody help me to find my mistake in order to solve the problem easily, please. I got WA from this problem.
Link of the problem is :

My code is:

#include <bits/stdc++.h>
#define PII pair<ll,ll>
typedef long long ll;

using namespace std;

const ll EPS=1e9+7;

PII fib(ll n)
{
if(n==0)
return {0, 1};

auto p=fib(n >> 1);
ll c=((p.first%EPS)*((2*(p.second%EPS))%EPS-p.first%EPS)%EPS)%EPS;
ll d=((p.first%EPS)*(p.first%EPS))%EPS+((p.second%EPS)*(p.second%EPS))%EPS;
if(n&1)
    return {d, (c + d)%EPS};
else
    return {c, d};

}

int main()
{
ll t,n;
cin>>t;
while(t–)
{
cin>>n;
PII ans=fib(n+1);
if(n==0)
cout<<0<<endl;
else if(n==1)
cout<<2<<endl;
else
cout<<(ans.first%EPS+ans.second%EPS)%EPS<<endl;
}
return 0;
}

Please help me…