#include<bits/stdc++.h>
#define LL long long
const LL mod=1e9+7;
inline void read(LL &a)
{
a=0;char c=getchar();
while(c<'0'||c>'9')c=getchar();
while(c>='0'&&c<='9')
{
a=(a<<1)+(a<<3)+c-'0';
c=getchar();
}
}
inline void write(LL a)
{
if(a<0){putchar('-');a=-a;}
if(a>9)write(a/10);
putchar(a%10+'0');
}
LL n,m;
inline LL fast_pow(LL a,LL b)
{
LL base=a,ans=1;
while(b)
{
if(b&1)ans=ans*base%mod;
base=base*base%mod;
b>>=1;
}
return ans;
}
inline LL step(LL x)
{
int ans=1;
while(x)
{
ans=ans*x%mod;
--x;
}
return ans;
}
inline LL C(LL m,LL n)
{
return step(m)*fast_pow(step(n)*step((m-n))%mod,mod-2)%mod;
}
int main()
{
read(m);read(n);
write(C(m,n));
return 0;
}