#include #include #include using namespace std; int main(){ int N,M; int a,b,c; cin>>N>>M; a=0,b=1,c=0; for(int i=3;i<=N;i++){ c=a+b; c=c%M; a=b%M; b=c%M; } cout<