N, K = map(int, input().split()) mod = 10 ** 9 + 7 n = 202020 fact = [1] * (n + 1) invfact = [1] * (n + 1) for i in range(1, n): fact[i + 1] = ((i+1) * fact[i]) % mod invfact[n] = pow(fact[n], mod - 2, mod) for i in range(n - 1, -1, -1): invfact[i] = invfact[i + 1] * (i + 1) % mod now = K + N - 1 val = 1 for i in range(N): val *= now - i val %= mod ans = 0 inv = pow(N, mod - 2, mod) for m in range(N): ans += inv * invfact[m] * invfact[N - 1 - m] * val ans %= mod val *= pow(now, mod - 2, mod) val *= now - N val %= mod now -= 1 print(ans)