https://cses.fi/problemset/stats/1716/
#include <bits/stdc++.h>
#define _ long long
#define R return
using namespace std; const _ N = 3e6+5,M=1e9+7; _ n,m,F[N]; _ P(_ a, _ b) {if(b==0)R 1;_ T=P(a,b/2)%M;T=(T*T)%M;if(b%2==0)R T;T=T*(a%M);T%=M;R T;} int main(){cin>>n>>m; F[0]=1;for(_ i=1;i<N;i++){F[i]=(F[i-1]*i)%M;} cout<<((F[m+n-1]*P(F[m+n-1-n+1], M-2))%M*(P(F[n-1],M-2)))%M; R 0; }