#include using namespace std; typedef long long LL; LL M; int FN(int n){ int n1=1; int n2=1; int tmp; while (n-2>1){ tmp=n1; n1+=n2; n2=tmp; n1%=M; n2%=M; n--; } return n1; } int main(int argc, char* argv[]) { int N; cin>>N>>M; cout<