n, k = map(int, input().split())

mod = 10 ** 9 + 7

fact = [1]
fact_inv = [0] * (n+1)
for i in range(n):
    fact.append(fact[-1] * (i+1) % mod)
fact_inv[-1] = pow(fact[-1], mod-2, mod)
for i in range(n-1, -1, -1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % mod

ans = 0
for i in range(min(n-1, k) + 1):
    com1 = fact[n] * fact_inv[i] * fact_inv[n-i] % mod
    com2 = fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % mod

print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 fact = [1] fact [1] 1 fact_inv = [0] * (n+1) fact_inv [0] * (n+1) [0] 0 n+1 n 1 for i in range(n):
    fact.append(fact[-1] * (i+1) % mod) i range(n) range n fact.append(fact[-1] * (i+1) % mod) fact.append fact append fact[-1] * (i+1) % mod fact[-1] * (i+1) fact[-1] fact -1 i+1 i 1 mod fact_inv[-1] = pow(fact[-1], mod-2, mod) fact_inv[-1] fact_inv -1 pow(fact[-1], mod-2, mod) pow fact[-1] fact -1 mod-2 mod 2 mod for i in range(n-1, -1, -1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % mod i range(n-1, -1, -1) range n-1 n 1 -1 -1 fact_inv[i] = fact_inv[i+1] * (i+1) % mod fact_inv[i] fact_inv i fact_inv[i+1] * (i+1) % mod fact_inv[i+1] * (i+1) fact_inv[i+1] fact_inv i+1 i 1 i+1 i 1 mod ans = 0 ans 0 for i in range(min(n-1, k) + 1):
    com1 = fact[n] * fact_inv[i] * fact_inv[n-i] % mod
    com2 = fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % mod i range(min(n-1, k) + 1) range min(n-1, k) + 1 min(n-1, k) min n-1 n 1 k 1 com1 = fact[n] * fact_inv[i] * fact_inv[n-i] % mod com1 fact[n] * fact_inv[i] * fact_inv[n-i] % mod fact[n] * fact_inv[i] * fact_inv[n-i] fact[n] * fact_inv[i] fact[n] fact n fact_inv[i] fact_inv i fact_inv[n-i] fact_inv n-i n i mod com2 = fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod com2 fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod fact[n-1] * fact_inv[i] * fact_inv[n-i-1] fact[n-1] * fact_inv[i] fact[n-1] fact n-1 n 1 fact_inv[i] fact_inv i fact_inv[n-i-1] fact_inv n-i-1 n-i n i 1 mod mul = com1 * com2 % mod mul com1 * com2 % mod com1 * com2 com1 com2 mod ans = (ans + mul) % mod ans (ans + mul) % mod ans + mul ans mul mod print(ans) print ans n, k = map(int, input().split()) map(int, input().split()) n fact = [1] [1] fact ans = 0 0 ans com1 = fact[n] * fact_inv[i] * fact_inv[n-i] % mod fact[n] * fact_inv[i] * fact_inv[n-i] % mod com1 mul = com1 * com2 % mod com1 * com2 % mod mul mod = 10 ** 9 + 7 10 ** 9 + 7 mod ans = (ans + mul) % mod (ans + mul) % mod ans fact_inv = [0] * (n+1) [0] * (n+1) fact_inv k = map(int, input().split()) map(int, input().split()) k com2 = fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod com2
n, k = map(int, input().split())

mod = 10 ** 9 + 7

fact = [1]
fact_inv = [0] * (n+1)
for i in range(n):
    fact.append(fact[-1] * (i+1) % mod)
fact_inv[-1] = pow(fact[-1], mod-2, mod)
for i in range(n-1, -1, -1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % mod

ans = 0
for i in range(min(n-1, k) + 1):
    com1 = fact[n] * fact_inv[i] * fact_inv[n-i] % mod
    com2 = fact[n-1] * fact_inv[i] * fact_inv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % mod

print(ans)