n, k = map(int, input().split())
mod = pow(10, 9) + 7
c1, c2 = 1, 1
n1, n2 = n, n - 1
ans = 1
for r in range(1, min(k + 1, n)):
    c1 = (c1 * n1 * pow(r, mod - 2, mod)) % mod
    c2 = (c2 * n2 * pow(r, mod - 2, mod)) % mod
    n1 -= 1
    n2 -= 1
    ans += (c1 * c2) % mod
    ans %= mod
print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k mod = pow(10, 9) + 7 mod pow(10, 9) + 7 pow(10, 9) pow 10 9 7 c1, c2 = 1, 1 c1 1 c2 1 n1, n2 = n, n - 1 n1 n n2 n - 1 n 1 ans = 1 ans 1 for r in range(1, min(k + 1, n)):
    c1 = (c1 * n1 * pow(r, mod - 2, mod)) % mod
    c2 = (c2 * n2 * pow(r, mod - 2, mod)) % mod
    n1 -= 1
    n2 -= 1
    ans += (c1 * c2) % mod
    ans %= mod r range(1, min(k + 1, n)) range 1 min(k + 1, n) min k + 1 k 1 n c1 = (c1 * n1 * pow(r, mod - 2, mod)) % mod c1 (c1 * n1 * pow(r, mod - 2, mod)) % mod c1 * n1 * pow(r, mod - 2, mod) c1 * n1 c1 n1 pow(r, mod - 2, mod) pow r mod - 2 mod 2 mod mod c2 = (c2 * n2 * pow(r, mod - 2, mod)) % mod c2 (c2 * n2 * pow(r, mod - 2, mod)) % mod c2 * n2 * pow(r, mod - 2, mod) c2 * n2 c2 n2 pow(r, mod - 2, mod) pow r mod - 2 mod 2 mod mod n1 -= 1 n1 1 n2 -= 1 n2 1 ans += (c1 * c2) % mod ans (c1 * c2) % mod c1 * c2 c1 c2 mod ans %= mod ans mod print(ans) print ans n, k = map(int, input().split()) map(int, input().split()) n mod = pow(10, 9) + 7 pow(10, 9) + 7 mod n2 -= 1 1 n2 ans += (c1 * c2) % mod (c1 * c2) % mod ans k = map(int, input().split()) map(int, input().split()) k n2 = n, n - 1 n - 1 n2 ans %= mod mod ans ans = 1 1 ans c1 = (c1 * n1 * pow(r, mod - 2, mod)) % mod (c1 * n1 * pow(r, mod - 2, mod)) % mod c1 c2 = 1, 1 1 c2 c2 = (c2 * n2 * pow(r, mod - 2, mod)) % mod (c2 * n2 * pow(r, mod - 2, mod)) % mod c2 n1, n2 = n, n - 1 n n1 n1 -= 1 1 n1 c1, c2 = 1, 1 1 c1
n, k = map(int, input().split())
mod = pow(10, 9) + 7
c1, c2 = 1, 1
n1, n2 = n, n - 1
ans = 1
for r in range(1, min(k + 1, n)):
    c1 = (c1 * n1 * pow(r, mod - 2, mod)) % mod
    c2 = (c2 * n2 * pow(r, mod - 2, mod)) % mod
    n1 -= 1
    n2 -= 1
    ans += (c1 * c2) % mod
    ans %= mod
print(ans)