N=2*10**5+1
mod=10**9+7
f=[None]*N
fi=[None]*N
f[0]=1
for i in range(1,N):
  f[i]=i*f[i-1]%mod
for i in range(N):
  fi[i]=pow(f[i],mod-2,mod)
def com(n,k):
  return f[n]*fi[n-k]%mod*fi[k]%mod
def hcom(n,k):
  return com(n+k-1,n-1)
n,k=map(int,input().split())
ans=1
for i in range(1,min(k+1,n)):
  ans=(ans+com(n,i)*hcom(n-i,i)%mod)%mod
print(ans) N=2*10**5+1 N 2*10**5+1 2*10**5 2 10**5 10 5 1 mod=10**9+7 mod 10**9+7 10**9 10 9 7 f=[None]*N f [None]*N [None] None N fi=[None]*N fi [None]*N [None] None N f[0]=1 f[0] f 0 1 for i in range(1,N):
  f[i]=i*f[i-1]%mod i range(1,N) range 1 N f[i]=i*f[i-1]%mod f[i] f i i*f[i-1]%mod i*f[i-1] i f[i-1] f i-1 i 1 mod for i in range(N):
  fi[i]=pow(f[i],mod-2,mod) i range(N) range N fi[i]=pow(f[i],mod-2,mod) fi[i] fi i pow(f[i],mod-2,mod) pow f[i] f i mod-2 mod 2 mod def com(n,k):
  return f[n]*fi[n-k]%mod*fi[k]%mod com return f[n]*fi[n-k]%mod*fi[k]%mod f[n]*fi[n-k]%mod*fi[k]%mod f[n]*fi[n-k]%mod*fi[k] f[n]*fi[n-k]%mod f[n]*fi[n-k] f[n] f n fi[n-k] fi n-k n k mod fi[k] fi k mod n n k k def hcom(n,k):
  return com(n+k-1,n-1) hcom return com(n+k-1,n-1) com(n+k-1,n-1) com n+k-1 n+k n k 1 n-1 n 1 n n k k n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k ans=1 ans 1 for i in range(1,min(k+1,n)):
  ans=(ans+com(n,i)*hcom(n-i,i)%mod)%mod i range(1,min(k+1,n)) range 1 min(k+1,n) min k+1 k 1 n ans=(ans+com(n,i)*hcom(n-i,i)%mod)%mod ans (ans+com(n,i)*hcom(n-i,i)%mod)%mod ans+com(n,i)*hcom(n-i,i)%mod ans com(n,i)*hcom(n-i,i)%mod com(n,i)*hcom(n-i,i) com(n,i) com n i hcom(n-i,i) hcom n-i n i i mod mod print(ans) print ans n,k=map(int,input().split()) map(int,input().split()) n mod=10**9+7 10**9+7 mod def hcom(n,k):
  return com(n+k-1,n-1) def hcom(n,k):
  return com(n+k-1,n-1) hcom ans=(ans+com(n,i)*hcom(n-i,i)%mod)%mod (ans+com(n,i)*hcom(n-i,i)%mod)%mod ans k=map(int,input().split()) map(int,input().split()) k f=[None]*N [None]*N f fi=[None]*N [None]*N fi def com(n,k):
  return f[n]*fi[n-k]%mod*fi[k]%mod def com(n,k):
  return f[n]*fi[n-k]%mod*fi[k]%mod com ans=1 1 ans N=2*10**5+1 2*10**5+1 N
N=2*10**5+1
mod=10**9+7
f=[None]*N
fi=[None]*N
f[0]=1
for i in range(1,N):
  f[i]=i*f[i-1]%mod
for i in range(N):
  fi[i]=pow(f[i],mod-2,mod)
def com(n,k):
  return f[n]*fi[n-k]%mod*fi[k]%mod
def hcom(n,k):
  return com(n+k-1,n-1)
n,k=map(int,input().split())
ans=1
for i in range(1,min(k+1,n)):
  ans=(ans+com(n,i)*hcom(n-i,i)%mod)%mod
print(ans)