n, k = map(int, input().split())
MOD = 10**9 + 7

fact = [0] * (n+1)
inv_fact = [0] * (n+1)

fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1] * i % MOD

inv_fact[n] = pow(fact[n], MOD-2, MOD)
for i in range(n, 0, -1):
    inv_fact[i-1] = inv_fact[i] * i % MOD


def nCk(n, k):
    return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD
  
ans = 1
for i in range(1, n):
    if i > k:
      break
    ans += nCk(n, i) * nCk(n-1, n-i-1) % MOD
print(ans % MOD) 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 = [0] * (n+1) fact [0] * (n+1) [0] 0 n+1 n 1 inv_fact = [0] * (n+1) inv_fact [0] * (n+1) [0] 0 n+1 n 1 fact[0] = 1 fact[0] fact 0 1 for i in range(1, n+1):
    fact[i] = fact[i-1] * i % MOD i range(1, n+1) range 1 n+1 n 1 fact[i] = fact[i-1] * i % MOD fact[i] fact i fact[i-1] * i % MOD fact[i-1] * i fact[i-1] fact i-1 i 1 i MOD inv_fact[n] = pow(fact[n], MOD-2, MOD) inv_fact[n] inv_fact n pow(fact[n], MOD-2, MOD) pow fact[n] fact n MOD-2 MOD 2 MOD for i in range(n, 0, -1):
    inv_fact[i-1] = inv_fact[i] * i % MOD i range(n, 0, -1) range n 0 -1 inv_fact[i-1] = inv_fact[i] * i % MOD inv_fact[i-1] inv_fact i-1 i 1 inv_fact[i] * i % MOD inv_fact[i] * i inv_fact[i] inv_fact i i MOD def nCk(n, k):
    return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD
   nCk return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD fact[n] * inv_fact[k] * inv_fact[n-k] % MOD fact[n] * inv_fact[k] * inv_fact[n-k] fact[n] * inv_fact[k] fact[n] fact n inv_fact[k] inv_fact k inv_fact[n-k] inv_fact n-k n k MOD n n k k ans = 1 ans 1 for i in range(1, n):
    if i > k:
      break
    ans += nCk(n, i) * nCk(n-1, n-i-1) % MOD i range(1, n) range 1 n if i > k:
      break
     i > k i k break ans += nCk(n, i) * nCk(n-1, n-i-1) % MOD ans nCk(n, i) * nCk(n-1, n-i-1) % MOD nCk(n, i) * nCk(n-1, n-i-1) nCk(n, i) nCk n i nCk(n-1, n-i-1) nCk n-1 n 1 n-i-1 n-i n i 1 MOD print(ans % MOD) print ans % MOD ans MOD n, k = map(int, input().split()) map(int, input().split()) n inv_fact = [0] * (n+1) [0] * (n+1) inv_fact ans += nCk(n, i) * nCk(n-1, n-i-1) % MOD nCk(n, i) * nCk(n-1, n-i-1) % MOD ans def nCk(n, k):
    return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD
   def nCk(n, k):
    return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD
   nCk ans = 1 1 ans fact = [0] * (n+1) [0] * (n+1) fact MOD = 10**9 + 7 10**9 + 7 MOD k = map(int, input().split()) map(int, input().split()) k
n, k = map(int, input().split())
MOD = 10**9 + 7

fact = [0] * (n+1)
inv_fact = [0] * (n+1)

fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1] * i % MOD

inv_fact[n] = pow(fact[n], MOD-2, MOD)
for i in range(n, 0, -1):
    inv_fact[i-1] = inv_fact[i] * i % MOD


def nCk(n, k):
    return fact[n] * inv_fact[k] * inv_fact[n-k] % MOD
  
ans = 1
for i in range(1, n):
    if i > k:
      break
    ans += nCk(n, i) * nCk(n-1, n-i-1) % MOD
print(ans % MOD)