#include using namespace std; #define rep(i, n) for (int i=0; i p; Fast_factorize(int n) { p.resize(n+1); fill(p.begin(), p.end(), -1); for (int i=2; i<=n; i++) if (p[i]==-1) { for (int j=i; j<=n; j+=i) { if (p[j]==-1) p[j] = i; } } } vector factorize(int n) { vector res; while (n>1) { res.pb(p[n]); n /= p[n]; } return res; } }; ll mod_pow(ll x, ll n) { ll res = 1; while (n>0) { if (n&1) res = res*x%MOD; x = x*x%MOD; n >>= 1; } return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); Fast_factorize ff(10000010); int M, N; cin >> M >> N; int cnt[10000010]; fill(cnt, cnt+10000010, 0); for (int i=M; i>=M-N+1; i--) { for (int p : ff.factorize(i)) cnt[p]++; } for (int i=1; i<=N; i++) { for (int p : ff.factorize(i)) cnt[p]--; } ll ans = 1; rep(i, 10000010) { ans *= mod_pow(i, cnt[i]); ans %= MOD; } string s = to_string(ans); if (s.size()<8) s = string(8-s.size(), '0')+s; cout << s << endl; }