#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define fi first #define se second #define mp make_pair #define rep(i, n) for(int i=0;i=0;--i) const int inf=1e9+7; const ll mod=1e9+7; const ll big=1e18; const double PI=2*asin(1); ll N, M; ll comb[100005]; ll P1[100005]; ll P2[100005]; ll frac[100005]; void prepare(){ P1[M] = 1; P1[M-1] = 1; for(ll i=M-2;i>0;--i){ P1[i] = P1[i+1]*(M-i); P1[i] %= mod; } P2[0] = 1; P2[1] = 1; for(ll i=2;i<=M;++i){ P2[i] = P2[i-1]*i; P2[i] %= mod; } ll shita1, shita2, tmpshita1, tmpshita2, h, two; comb[0] = 1; for(int k=1;k<=M;++k){ h = mod - 2; shita1 = 1; shita2 = 1; while(h>0){ two = 1; tmpshita1 = P1[k]; tmpshita2 = P2[k]; while(2*two<=h){ two *= 2; tmpshita1 *= tmpshita1; tmpshita1 %= mod; tmpshita2 *= tmpshita2; tmpshita2 %= mod; } h -= two; shita1 *= tmpshita1; shita1 %= mod; shita2 *= tmpshita2; shita2 %= mod; } comb[k] = P2[M]*shita1%mod*shita2%mod; } ll tmp; for(ll k=0;k<=M;++k){ h = N; frac[k] = 1; while(h>0){ two = 1; tmp = k; while(2*two<=h){ two *= 2; tmp *= tmp; tmp %= mod; } h -= two; frac[k] *= tmp; frac[k] %= mod; } } } int main() { cin>>N>>M; if(N