#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< P; ll n,m; ll powmod(ll a,ll b){ ll r=1; while(b){ if(b&1)r=r*a%MOD; a=a*a%MOD; b>>=1; } return r; } ll fact[125252]; ll init(){ fact[0] = 1; FOR(i,1,125252)fact[i]=i*fact[i-1]%MOD; } ll comb(ll a,ll b){ return fact[a]*powmod(fact[b],MOD-2)%MOD*powmod(fact[a-b],MOD-2)%MOD; } int main(){ init(); cin>>n>>m; if(n=1;--i){ ans += sign*powmod(i,n%(MOD-1))%MOD*comb(m,i); sign *= -1; ans = FIX(ans); } cout<