#include using namespace std; using ll=long long; using ld=long double; using P=pair; using V=vector; #define rep(i,n) for(int i=0;i> n >> k; ll ans=0; rep(i,n){ ans+=powk(i,k)*comb(n-1,i); ans%=p; } cout << ans << endl; }