n,k=map(int,input().split())
mod=10**9+7
lim=n
fcl=[1]*(lim+1)
for i in range(1,lim+1):
  fcl[i]=(fcl[i-1]*i)%mod
def comb(x,y,p):
  return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p
ans=0
for i in range(min(n,k+1)):
  ans+=comb(n-1,n-i-1,mod)*comb(n,i,mod)
  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 lim=n lim n fcl=[1]*(lim+1) fcl [1]*(lim+1) [1] 1 lim+1 lim 1 for i in range(1,lim+1):
  fcl[i]=(fcl[i-1]*i)%mod i range(1,lim+1) range 1 lim+1 lim 1 fcl[i]=(fcl[i-1]*i)%mod fcl[i] fcl i (fcl[i-1]*i)%mod fcl[i-1]*i fcl[i-1] fcl i-1 i 1 i mod def comb(x,y,p):
  return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p comb return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p (fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p) (fcl[x]*pow(fcl[y],p-2,p))%p fcl[x]*pow(fcl[y],p-2,p) fcl[x] fcl x pow(fcl[y],p-2,p) pow fcl[y] fcl y p-2 p 2 p p pow(fcl[x-y],p-2,p) pow fcl[x-y] fcl x-y x y p-2 p 2 p p x x y y p p ans=0 ans 0 for i in range(min(n,k+1)):
  ans+=comb(n-1,n-i-1,mod)*comb(n,i,mod)
  ans%=mod i range(min(n,k+1)) range min(n,k+1) min n k+1 k 1 ans+=comb(n-1,n-i-1,mod)*comb(n,i,mod) ans comb(n-1,n-i-1,mod)*comb(n,i,mod) comb(n-1,n-i-1,mod) comb n-1 n 1 n-i-1 n-i n i 1 mod comb(n,i,mod) comb n i mod ans%=mod ans mod print(ans) print ans def comb(x,y,p):
  return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p def comb(x,y,p):
  return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p comb ans=0 0 ans ans+=comb(n-1,n-i-1,mod)*comb(n,i,mod) comb(n-1,n-i-1,mod)*comb(n,i,mod) ans lim=n n lim fcl=[1]*(lim+1) [1]*(lim+1) fcl mod=10**9+7 10**9+7 mod k=map(int,input().split()) map(int,input().split()) k ans%=mod mod ans n,k=map(int,input().split()) map(int,input().split()) n
n,k=map(int,input().split())
mod=10**9+7
lim=n
fcl=[1]*(lim+1)
for i in range(1,lim+1):
  fcl[i]=(fcl[i-1]*i)%mod
def comb(x,y,p):
  return ((fcl[x]*pow(fcl[y],p-2,p))%p*pow(fcl[x-y],p-2,p))%p
ans=0
for i in range(min(n,k+1)):
  ans+=comb(n-1,n-i-1,mod)*comb(n,i,mod)
  ans%=mod
print(ans)