凡是对大数取余的 一般都是用卢卡斯逆元
#include <iostream>
#include<stdio.h>
using namespace std;
const int p=1e9+7;
typedef long long ll;
ll qmi(ll a,ll k)//用到快速幂/逆元/组合公式
{
ll res=1;
while(k)
{
if(k&1)
res=res*a%p;
a=a*a%p;
k>>=1;
}
return res;
}
ll C(int a,int b)
{
ll res=1;
for(ll i=1,j=a; i<=b; i++,j--)
{
res=res*j%p;
res=res*qmi(i,p-2)%p;
}
return res;
}
ll lucas(ll a,ll b)
{
if(a<p&&b<p)
return C(a,b);
return
C(a%p,b%p)*lucas(a/p,b/p)%p;
}
int main()
{
ll m,n,i;
ll ans=0,ans1=0;
scanf("%lld%lld",&m,&n);
printf("%lld\n",lucas(m,n));
return 0;
}