#include "bits/stdc++.h" #define REP(i,n) for(int i=0;i> n >> m; ll res = 1; REP(i,n){ res*=(i+1); res%=m; } put(res); return 0; }