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

up = [1] * (n + 1)
down = [0] * (n + 1)
for i in range(1, n + 1):
  up[i] = (up[i - 1] * i) % D
down[n] = pow(up[n], D - 2, D)
for i in range(n, 0, -1):
  down[i - 1] = (down[i] * i) % D
  
def cmd(n, r, D):
  if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D

A = 0
k = min(k, n-1)
t = 0
while t <=k:
  A = (A + cmd(n-1, t, D) * cmd(n, t, D)) % D
  t = t+1
print (A) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k D = 10**9 + 7 D 10**9 + 7 10**9 10 9 7 up = [1] * (n + 1) up [1] * (n + 1) [1] 1 n + 1 n 1 down = [0] * (n + 1) down [0] * (n + 1) [0] 0 n + 1 n 1 for i in range(1, n + 1):
  up[i] = (up[i - 1] * i) % D i range(1, n + 1) range 1 n + 1 n 1 up[i] = (up[i - 1] * i) % D up[i] up i (up[i - 1] * i) % D up[i - 1] * i up[i - 1] up i - 1 i 1 i D down[n] = pow(up[n], D - 2, D) down[n] down n pow(up[n], D - 2, D) pow up[n] up n D - 2 D 2 D for i in range(n, 0, -1):
  down[i - 1] = (down[i] * i) % D
   i range(n, 0, -1) range n 0 -1 down[i - 1] = (down[i] * i) % D down[i - 1] down i - 1 i 1 (down[i] * i) % D down[i] * i down[i] down i i D def cmd(n, r, D):
  if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D cmd if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D r < 0 or r > n r < 0 r 0 r > n r n return 0 0 return (up[n] * down[r] * down[n - r]) % D (up[n] * down[r] * down[n - r]) % D up[n] * down[r] * down[n - r] up[n] * down[r] up[n] up n down[r] down r down[n - r] down n - r n r D n n r r D D A = 0 A 0 k = min(k, n-1) k min(k, n-1) min k n-1 n 1 t = 0 t 0 while t <=k:
  A = (A + cmd(n-1, t, D) * cmd(n, t, D)) % D
  t = t+1 t <=k t k A = (A + cmd(n-1, t, D) * cmd(n, t, D)) % D A (A + cmd(n-1, t, D) * cmd(n, t, D)) % D A + cmd(n-1, t, D) * cmd(n, t, D) A cmd(n-1, t, D) * cmd(n, t, D) cmd(n-1, t, D) cmd n-1 n 1 t D cmd(n, t, D) cmd n t D D t = t+1 t t+1 t 1 print (A) print A down = [0] * (n + 1) [0] * (n + 1) down up = [1] * (n + 1) [1] * (n + 1) up A = 0 0 A k = min(k, n-1) min(k, n-1) k n, k = map(int, input().split()) map(int, input().split()) n D = 10**9 + 7 10**9 + 7 D A = (A + cmd(n-1, t, D) * cmd(n, t, D)) % D (A + cmd(n-1, t, D) * cmd(n, t, D)) % D A t = 0 0 t k = map(int, input().split()) map(int, input().split()) k t = t+1 t+1 t def cmd(n, r, D):
  if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D def cmd(n, r, D):
  if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D cmd
n, k = map(int, input().split())
D = 10**9 + 7

up = [1] * (n + 1)
down = [0] * (n + 1)
for i in range(1, n + 1):
  up[i] = (up[i - 1] * i) % D
down[n] = pow(up[n], D - 2, D)
for i in range(n, 0, -1):
  down[i - 1] = (down[i] * i) % D
  
def cmd(n, r, D):
  if r < 0 or r > n:
    return 0
  else:
    return (up[n] * down[r] * down[n - r]) % D

A = 0
k = min(k, n-1)
t = 0
while t <=k:
  A = (A + cmd(n-1, t, D) * cmd(n, t, D)) % D
  t = t+1
print (A)