Why my solution is wrong?

#include
#include<bits/stdc++.h>
using namespace std;

int mod=1e7+7;

long long int solve(int n){
long long int dp[n+1]={0};

dp[0]=0;
dp[1]=1;
dp[2]=2;
for(int i=3;i<=n;i++){
	dp[i]=(dp[i-1]%mod+dp[i-2]%mod)%mod;
}
return dp[n];

}

int main() {
long long int n;
cin >> n;
cout << solve(n);
return 0;
}