#include <cstdio>
using namespace std;
#define sci(x) int x; scanf("%d", &x);
#define scii(x, y) int x, y; scanf("%d%d", &x, &y);
#define REP(i, y) for (int i = 0; i < y; i++)
#define REPI(i, y) for (int i = y-1; i > -1; i--)
typedef long long ll;
const int INF = 2 << 30;
const double EPS = 1E-8;
const int MAX_N = 100001;
const int MAX_K = 100001;
int mod = 1e9 + 7;
int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;}
int substract (int x, int y) {if (x >= y) return x - y; return x - y + mod;}
int mul (int x, int y) {return 1LL * x * y % mod;}
int pow (int a, int b)
{
int p = 1;
for (int i=0; (1<<i) <= b; i++)
{
if (b & (1 << i)) p = mul (p, a);
a = mul (a, a);
}
return p;
}
int main() {
scii(n, k);
int ans=1;
REP(i, k){
ans = mul(ans, n+i);
}
ll norm=1;
for (int j = 1; j <= k; ++j) {
//norm *= j;
norm = mul(norm, j);
}
int reversed_norm = pow(norm, mod-2);
printf("%d\n", mul(ans, reversed_norm));
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:58: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define scii(x, y) int x, y; scanf("%d%d", &x, &y);
^
./Main.cpp:32:3: note: in expansion of macro ‘scii’
scii(n, k);
^