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

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
def COMinit():
  #N_C_kのN
  for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod)


def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod


COMinit()
ans = 0
for i in range(min(n, k)+1):
  tmp = COM(n, i) % Mod
  tmp *= COM(i+n-i-1, i)
  tmp %= Mod
  ans += tmp
  ans %= 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 fac = [1, 1] fac [1, 1] 1 1 finv = [1, 1] finv [1, 1] 1 1 inv = [0, 1] inv [0, 1] 0 1 def COMinit():
  #N_C_kのN
  for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod) COMinit for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod) i range(2, n+10) range 2 n+10 n 10 fac.append(fac[-1]*i%Mod) fac.append fac append fac[-1]*i%Mod fac[-1]*i fac[-1] fac -1 i Mod inv.append((-inv[Mod%i] * (Mod//i)) % Mod) inv.append inv append (-inv[Mod%i] * (Mod//i)) % Mod -inv[Mod%i] * (Mod//i) -inv[Mod%i] inv[Mod%i] inv Mod%i Mod i Mod//i Mod i Mod finv.append(finv[-1] * inv[-1] % Mod) finv.append finv append finv[-1] * inv[-1] % Mod finv[-1] * inv[-1] finv[-1] finv -1 inv[-1] inv -1 Mod def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod COM if n < 0 or k < 0 or n < k:
    return 0
   n < 0 or k < 0 or n < k n < 0 or k < 0 n < 0 n 0 k < 0 k 0 n < k n k return 0 0 return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod fac[n] * (finv[k] * finv[n-k] % Mod) % Mod fac[n] * (finv[k] * finv[n-k] % Mod) fac[n] fac n finv[k] * finv[n-k] % Mod finv[k] * finv[n-k] finv[k] finv k finv[n-k] finv n-k n k Mod Mod n n k k COMinit() COMinit ans = 0 ans 0 for i in range(min(n, k)+1):
  tmp = COM(n, i) % Mod
  tmp *= COM(i+n-i-1, i)
  tmp %= Mod
  ans += tmp
  ans %= Mod i range(min(n, k)+1) range min(n, k)+1 min(n, k) min n k 1 tmp = COM(n, i) % Mod tmp COM(n, i) % Mod COM(n, i) COM n i Mod tmp *= COM(i+n-i-1, i) tmp COM(i+n-i-1, i) COM i+n-i-1 i+n-i i+n i n i 1 i tmp %= Mod tmp Mod ans += tmp ans tmp ans %= Mod ans Mod print(ans) print ans ans %= Mod Mod ans tmp *= COM(i+n-i-1, i) COM(i+n-i-1, i) tmp finv = [1, 1] [1, 1] finv ans += tmp tmp ans Mod = 10**9+7 10**9+7 Mod tmp = COM(n, i) % Mod COM(n, i) % Mod tmp n, k = map(int, input().split()) map(int, input().split()) n def COMinit():
  #N_C_kのN
  for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod) def COMinit():
  #N_C_kのN
  for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod) COMinit ans = 0 0 ans def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod COM inv = [0, 1] [0, 1] inv fac = [1, 1] [1, 1] fac tmp %= Mod Mod tmp k = map(int, input().split()) map(int, input().split()) k
n, k = map(int, input().split())
Mod = 10**9+7

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
def COMinit():
  #N_C_kのN
  for i in range(2, n+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod)


def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod


COMinit()
ans = 0
for i in range(min(n, k)+1):
  tmp = COM(n, i) % Mod
  tmp *= COM(i+n-i-1, i)
  tmp %= Mod
  ans += tmp
  ans %= Mod
print(ans)