MOD = 10 ** 9 + 7 n, k = map(int, input().split()) ans = 0 def comb(n, k): if k > n or k < 0: return 0 ret = 1 k = min(k, n - k) for i in range(n, n - k, -1): ret *= i for i in range(1, k + 1): ret //= i return ret a = 1 b = 1 nn = n + k - 1 rr = n for i in range(nn, nn - rr, -1): b *= i b %= MOD inv = 1 for i in range(1, rr + 1): inv *= i inv %= MOD b *= pow(inv, MOD - 2, MOD) b %= MOD for i in range(n): ans += a * b ans %= MOD a *= (n - 1 - i) * pow(i + 1, MOD - 2, MOD) % MOD a %= MOD b *= pow(n + k - 1 - i, MOD - 2, MOD) * (k - 1 - i) % MOD b %= MOD print(ans)