n,k=map(int,input().split())
factorial=[1]
for i in range(1,2*n):
  factorial.append((factorial[i-1]*(i+1))%(10**9+7))
inv=[]
for i in range(n):
  inv.append(pow(factorial[i],10**9+5,10**9+7))
if k>=n-1:
  print((factorial[2*n-2]*inv[n-1]*inv[n-2])%(10**9+7))
else:
  ans=1
  for i in range (k):
    ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7)
  if k==1:
    ans-=1
  print(ans) n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k factorial=[1] factorial [1] 1 for i in range(1,2*n):
  factorial.append((factorial[i-1]*(i+1))%(10**9+7)) i range(1,2*n) range 1 2*n 2 n factorial.append((factorial[i-1]*(i+1))%(10**9+7)) factorial.append factorial append (factorial[i-1]*(i+1))%(10**9+7) factorial[i-1]*(i+1) factorial[i-1] factorial i-1 i 1 i+1 i 1 10**9+7 10**9 10 9 7 inv=[] inv [] for i in range(n):
  inv.append(pow(factorial[i],10**9+5,10**9+7)) i range(n) range n inv.append(pow(factorial[i],10**9+5,10**9+7)) inv.append inv append pow(factorial[i],10**9+5,10**9+7) pow factorial[i] factorial i 10**9+5 10**9 10 9 5 10**9+7 10**9 10 9 7 if k>=n-1:
  print((factorial[2*n-2]*inv[n-1]*inv[n-2])%(10**9+7))
else:
  ans=1
  for i in range (k):
    ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7)
  if k==1:
    ans-=1
  print(ans) k>=n-1 k n-1 n 1 print((factorial[2*n-2]*inv[n-1]*inv[n-2])%(10**9+7)) print (factorial[2*n-2]*inv[n-1]*inv[n-2])%(10**9+7) factorial[2*n-2]*inv[n-1]*inv[n-2] factorial[2*n-2]*inv[n-1] factorial[2*n-2] factorial 2*n-2 2*n 2 n 2 inv[n-1] inv n-1 n 1 inv[n-2] inv n-2 n 2 10**9+7 10**9 10 9 7 ans=1 ans 1 for i in range (k):
    ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7)
   i range (k) range k ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7) ans (ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7) ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3] ans factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3] factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i] factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2] factorial[n-1]*inv[i]*inv[n-i-2] factorial[n-1]*inv[i] factorial[n-1] factorial n-1 n 1 inv[i] inv i inv[n-i-2] inv n-i-2 n-i n i 2 factorial[n-2] factorial n-2 n 2 inv[i] inv i inv[n-i-3] inv n-i-3 n-i n i 3 10**9+7 10**9 10 9 7 if k==1:
    ans-=1
   k==1 k 1 ans-=1 ans 1 print(ans) print ans ans=1 1 ans ans-=1 1 ans n,k=map(int,input().split()) map(int,input().split()) n factorial=[1] [1] factorial inv=[] [] inv k=map(int,input().split()) map(int,input().split()) k ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7) (ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7) ans
n,k=map(int,input().split())
factorial=[1]
for i in range(1,2*n):
  factorial.append((factorial[i-1]*(i+1))%(10**9+7))
inv=[]
for i in range(n):
  inv.append(pow(factorial[i],10**9+5,10**9+7))
if k>=n-1:
  print((factorial[2*n-2]*inv[n-1]*inv[n-2])%(10**9+7))
else:
  ans=1
  for i in range (k):
    ans=(ans+factorial[n-1]*inv[i]*inv[n-i-2]*factorial[n-2]*inv[i]*inv[n-i-3])%(10**9+7)
  if k==1:
    ans-=1
  print(ans)
