n,k=map(int,input().split())
k=min(k,n-1)
mod=10000*100000+7
def mpow(a,b,m=100000*10000+7):#returns a**b%m
  ret=1
  while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
  return ret
fact=[1]*(n+1)
ifact=[1]*(n+1)
for i in range(2,n+1):
  fact[i]=(fact[i-1] *i)%mod
ifact[n]=mpow(fact[n],mod-2)
for i in range(n-1,1,-1):
  ifact[i]=((i+1)*ifact[i+1])%mod
def nCr(n,r):
  if r==0 or r==n:
    return 1
  val=(fact[n]*ifact[r])%mod
  return (val*ifact[n-r])%mod
ans=0
for h in range(k+1):
  ans=(ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod
print(ans) n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k k=min(k,n-1) k min(k,n-1) min k n-1 n 1 mod=10000*100000+7 mod 10000*100000+7 10000*100000 10000 100000 7 def mpow(a,b,m=100000*10000+7):#returns a**b%m
  ret=1
  while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
  return ret mpow ret=1 ret 1 while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
   b>0 b 0 if b&1:
      ret=(ret*a)%m
     b&1 b 1 ret=(ret*a)%m ret (ret*a)%m ret*a ret a m a=(a*a)%m a (a*a)%m a*a a a m b>>=1 b 1 return ret ret a a b b m=100000*10000+7 m 100000*10000+7 100000*10000 100000 10000 7 fact=[1]*(n+1) fact [1]*(n+1) [1] 1 n+1 n 1 ifact=[1]*(n+1) ifact [1]*(n+1) [1] 1 n+1 n 1 for i in range(2,n+1):
  fact[i]=(fact[i-1] *i)%mod i range(2,n+1) range 2 n+1 n 1 fact[i]=(fact[i-1] *i)%mod fact[i] fact i (fact[i-1] *i)%mod fact[i-1] *i fact[i-1] fact i-1 i 1 i mod ifact[n]=mpow(fact[n],mod-2) ifact[n] ifact n mpow(fact[n],mod-2) mpow fact[n] fact n mod-2 mod 2 for i in range(n-1,1,-1):
  ifact[i]=((i+1)*ifact[i+1])%mod i range(n-1,1,-1) range n-1 n 1 1 -1 ifact[i]=((i+1)*ifact[i+1])%mod ifact[i] ifact i ((i+1)*ifact[i+1])%mod (i+1)*ifact[i+1] i+1 i 1 ifact[i+1] ifact i+1 i 1 mod def nCr(n,r):
  if r==0 or r==n:
    return 1
  val=(fact[n]*ifact[r])%mod
  return (val*ifact[n-r])%mod nCr if r==0 or r==n:
    return 1
   r==0 or r==n r==0 r 0 r==n r n return 1 1 val=(fact[n]*ifact[r])%mod val (fact[n]*ifact[r])%mod fact[n]*ifact[r] fact[n] fact n ifact[r] ifact r mod return (val*ifact[n-r])%mod (val*ifact[n-r])%mod val*ifact[n-r] val ifact[n-r] ifact n-r n r mod n n r r ans=0 ans 0 for h in range(k+1):
  ans=(ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod h range(k+1) range k+1 k 1 ans=(ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod ans (ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod ans (nCr(n,h)*nCr(n-1,n-h-1))%mod nCr(n,h)*nCr(n-1,n-h-1) nCr(n,h) nCr n h nCr(n-1,n-h-1) nCr n-1 n 1 n-h-1 n-h n h 1 mod mod print(ans) print ans n,k=map(int,input().split()) map(int,input().split()) n ans=0 0 ans k=map(int,input().split()) map(int,input().split()) k def nCr(n,r):
  if r==0 or r==n:
    return 1
  val=(fact[n]*ifact[r])%mod
  return (val*ifact[n-r])%mod def nCr(n,r):
  if r==0 or r==n:
    return 1
  val=(fact[n]*ifact[r])%mod
  return (val*ifact[n-r])%mod nCr ans=(ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod (ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod ans k=min(k,n-1) min(k,n-1) k def mpow(a,b,m=100000*10000+7):#returns a**b%m
  ret=1
  while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
  return ret def mpow(a,b,m=100000*10000+7):#returns a**b%m
  ret=1
  while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
  return ret mpow mod=10000*100000+7 10000*100000+7 mod fact=[1]*(n+1) [1]*(n+1) fact ifact=[1]*(n+1) [1]*(n+1) ifact
n,k=map(int,input().split())
k=min(k,n-1)
mod=10000*100000+7
def mpow(a,b,m=100000*10000+7):#returns a**b%m
  ret=1
  while b>0:
    if b&1:
      ret=(ret*a)%m
    a=(a*a)%m
    b>>=1
  return ret
fact=[1]*(n+1)
ifact=[1]*(n+1)
for i in range(2,n+1):
  fact[i]=(fact[i-1] *i)%mod
ifact[n]=mpow(fact[n],mod-2)
for i in range(n-1,1,-1):
  ifact[i]=((i+1)*ifact[i+1])%mod
def nCr(n,r):
  if r==0 or r==n:
    return 1
  val=(fact[n]*ifact[r])%mod
  return (val*ifact[n-r])%mod
ans=0
for h in range(k+1):
  ans=(ans+(nCr(n,h)*nCr(n-1,n-h-1))%mod)%mod
print(ans)
