#include <stdio.h>
#include <iostream>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
ll fact[200005];
ll quickPow(ll a,ll k){
ll ret = 1,mc = a;
while(k!=0){
if(k&1){
ret=ret*mc%mod;
k--;
}
k = k/2;
mc = mc*mc%mod;
}
return ret%mod;
}
ll ni(ll a){
return quickPow(a,mod-2);
}
ll c(ll n,ll m){
ll ans = ((fact[n]*ni(fact[m]))%mod)*ni(fact[n-m])%mod;
return ans;
}
int main(){
ll n,m;
cin>>n>>m;
fact[0] = 1;
for(int i = 1;i<=n;i++){
fact[i] = fact[i-1]*i%mod;
}
cout<<c(n,m);
return 0;
}