#include<bits/stdc++.h> usingnamespace std; constint MAXN = 2e6; constlonglong MOD = 1e9 + 7; longlong n, m, inv[MAXN + 1]; voidinverseElement() { inv[1] = 1; for (int i = 2; i <= MAXN; i++) inv[i] = (longlong)(MOD - MOD / i) * inv[MOD % i] % MOD; } intmain() { inverseElement(); while (cin >> n >> m) { longlong ans = 0, sum = 1; for (int j = 1; j <= m; j++) sum *= j, sum %= MOD; ans += sum, ans %= MOD; for (int i = 2; i <= n; i++) { sum = ((sum % MOD) * (((i + m - 1) * inv[i - 1]) % MOD)) % MOD; ans += sum, ans %= MOD; } cout << ans % MOD << endl; } return0; }