#include #include #include #include using namespace std; int fiv(int x); int n,m; int main(void){ int result; cin >> n >> m; result = fiv(n); cout << result << "\n"; return 0; } int fiv(int x){ switch (x) { case 1: return 0; break; case 2: return 1; break; default: return (fiv(x-1)+fiv(x-2))%m; } }