#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<0){ if(n&1) res=res*x%mod; x=x*x%mod; n>>=1; } return res; } long comb(long n, long r){ long p=1; for (long i=1;i<=r;i++) p=p*(n-i+1)/i; return p; } long calc(long n, long m){ if(dp[m]!=-1) return dp[m]; long res = mod_pow(m,n,MOD); for(long i=m-1; i>=1; i--){ res = (res - comb(m,i)*calc(n, i) + MOD)%MOD; } return dp[m] = res; } int main(){ long n,m; cin>>n>>m; if(m>n){ cout<<0<