M=10**9+7
n,k=map(int,input().split())
l=[1]
f=1
for i in range(n):
  f=f*(i+1)%M
  l+=[f]
a=0
for i in range(min(n,k+1)):
  c=p=1
  c=c*l[n]*l[n-1]%M
  p=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 l=[1] l [1] 1 f=1 f 1 for i in range(n):
  f=f*(i+1)%M
  l+=[f] i range(n) range n f=f*(i+1)%M f f*(i+1)%M f*(i+1) f i+1 i 1 M l+=[f] l [f] f a=0 a 0 for i in range(min(n,k+1)):
  c=p=1
  c=c*l[n]*l[n-1]%M
  p=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=p=1 c 1 =p=1 p 1 c=c*l[n]*l[n-1]%M c c*l[n]*l[n-1]%M c*l[n]*l[n-1] c*l[n] c l[n] l n l[n-1] l n-1 n 1 M p=p*l[i]**2*l[n-i]*l[n-i-1]%M p p*l[i]**2*l[n-i]*l[n-i-1]%M p*l[i]**2*l[n-i]*l[n-i-1] p*l[i]**2*l[n-i] p*l[i]**2 p 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 l=[1] [1] l p=p*l[i]**2*l[n-i]*l[n-i-1]%M p*l[i]**2*l[n-i]*l[n-i-1]%M p p=1 1 p n,k=map(int,input().split()) map(int,input().split()) n c=p=1 1 c a+=c*pow(p,M-2,M) c*pow(p,M-2,M) a l+=[f] [f] l c=c*l[n]*l[n-1]%M c*l[n]*l[n-1]%M c M=10**9+7 10**9+7 M f=1 1 f f=f*(i+1)%M f*(i+1)%M f a=0 0 a
M=10**9+7
n,k=map(int,input().split())
l=[1]
f=1
for i in range(n):
  f=f*(i+1)%M
  l+=[f]
a=0
for i in range(min(n,k+1)):
  c=p=1
  c=c*l[n]*l[n-1]%M
  p=p*l[i]**2*l[n-i]*l[n-i-1]%M
  a+=c*pow(p,M-2,M)
print(a%M)