M=10**9+7
n,k=map(int,input().split())
from functools import lru_cache
@lru_cache(None)
def f(x):
  if x: return x*f(x-1)%M
  return 1
l=[f(i) for i in range(n+1)]
a=0
for i in range(min(n,k+1)):
  c=l[n]*l[n-1]%M
  p=l[i]**2*l[n-i]*l[n-i-1]%M
  a+=c*pow(p,M-2,M)
print(a%M) M=10**9+7 M 10**9+7 10**9 10 9 7 n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k from functools import lru_cache def f(x):
  if x: return x*f(x-1)%M
  return 1 f if x: return x*f(x-1)%M
   x return 1 1 x x @lru_cache(None) f None @lru_cache(None) lru_cache None f f(i) for i in range(n+1) for i in range(n+1) i range(n+1) range n+1 n 1 for i in range(n+1) f(i) f i l=[f(i) for i in range(n+1)] l [f(i) for i in range(n+1)] a=0 a 0 for i in range(min(n,k+1)):
  c=l[n]*l[n-1]%M
  p=l[i]**2*l[n-i]*l[n-i-1]%M
  a+=c*pow(p,M-2,M) i range(min(n,k+1)) range min(n,k+1) min n k+1 k 1 c=l[n]*l[n-1]%M c l[n]*l[n-1]%M l[n]*l[n-1] l[n] l n l[n-1] l n-1 n 1 M p=l[i]**2*l[n-i]*l[n-i-1]%M p l[i]**2*l[n-i]*l[n-i-1]%M l[i]**2*l[n-i]*l[n-i-1] l[i]**2*l[n-i] l[i]**2 l[i] l i 2 l[n-i] l n-i n i l[n-i-1] l n-i-1 n-i n i 1 M a+=c*pow(p,M-2,M) a c*pow(p,M-2,M) c pow(p,M-2,M) pow p M-2 M 2 M print(a%M) print a%M a M k=map(int,input().split()) map(int,input().split()) k p=l[i]**2*l[n-i]*l[n-i-1]%M l[i]**2*l[n-i]*l[n-i-1]%M p l=[f(i) for i in range(n+1)] [f(i) for i in range(n+1)] l M=10**9+7 10**9+7 M a=0 0 a c=l[n]*l[n-1]%M l[n]*l[n-1]%M c def f(x):
  if x: return x*f(x-1)%M
  return 1 def f(x):
  if x: return x*f(x-1)%M
  return 1 f a+=c*pow(p,M-2,M) c*pow(p,M-2,M) a n,k=map(int,input().split()) map(int,input().split()) n
M=10**9+7
n,k=map(int,input().split())
from functools import lru_cache
@lru_cache(None)
def f(x):
  if x: return x*f(x-1)%M
  return 1
l=[f(i) for i in range(n+1)]
a=0
for i in range(min(n,k+1)):
  c=l[n]*l[n-1]%M
  p=l[i]**2*l[n-i]*l[n-i-1]%M
  a+=c*pow(p,M-2,M)
print(a%M)