int fib(int n){
if (n == 0)
return 0;
if (n == 1 || n == 2)
return 1;
int pre=1;
int prepre=1;
int curr = 0;
for (int i=3; i <= n; i++)
{
curr = (pre + prepre) % 1000000007;
prepre = pre;
pre = curr;
}
return curr;
}