my code
#include<bits/stdc++.h>
using namespace std;
#define endl “\n”
#define sd(val) scanf("%d",&val)
#define ss(val) scanf("%s",&val)
#define sl(val) scanf("%lld",&val)
#define all(v) v.begin(),v.end()
#define PB push_back
#define MP make_pair
#define FF first
#define SS second
#define ll long long int
#define m 1000000007
#define clr(val) memset(val,0,sizeof(val))
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
/#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif/
ll n,r;
cin>>n>>r;
ll ans=1;
if(r==0)
cout<<1;
else{
for(ll i=1;i<=r;i++)
{
ans=((ans%m)*(n-r+i)%m)%m;
ans/=i;
}
cout<<(ans+m)%m;
}
return 0;
}