#include<iostream>usingnamespace std;typedeflonglong ll;constint N =1e5+10, mod =1e9+7;
ll n, m;
ll inv[N], fac[N];//fac为阶乘voidinit(ll n){
inv[0]= inv[1]= fac[0]= fac[1]=1;for(ll i =2; i <= n; i ++)
inv[i]= inv[mod % i]*(mod - mod / i)% mod;for(ll i =2; i <= n; i ++)
inv[i]= inv[i]* inv[i -1]% mod;for(ll i =1; i <= n; i ++)
fac[i]= fac[i -1]* i % mod;}
ll C(ll m, ll n){return fac[n]* inv[m]% mod * inv[n - m]% mod;}intmain(){init(10000);
cin >> m >> n;
cout <<C(m, n)<< endl;return0;}