n,k = map(int,input().split())
mod = 1000000007
def comb(n,k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n]*finv[k]%mod*finv[n-k]%mod
fac = [1]*(n+1)
finv = [1]*(n+1)
for i in range(1,n+1):
    fac[i] = fac[i-1]*i%mod
    finv[i] = pow(fac[i],mod-2,mod)

ans = 0
for i in range(min(k+1,n)):
    ans += comb(n,i)*comb(n-1,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 = 1000000007 mod 1000000007 def comb(n,k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n]*finv[k]%mod*finv[n-k]%mod comb if n < k: return 0
     n < k n k if n < 0 or k < 0: return 0
     n < 0 or k < 0 n < 0 n 0 k < 0 k 0 return fac[n]*finv[k]%mod*finv[n-k]%mod fac[n]*finv[k]%mod*finv[n-k]%mod fac[n]*finv[k]%mod*finv[n-k] fac[n]*finv[k]%mod fac[n]*finv[k] fac[n] fac n finv[k] finv k mod finv[n-k] finv n-k n k mod n n k k fac = [1]*(n+1) fac [1]*(n+1) [1] 1 n+1 n 1 finv = [1]*(n+1) finv [1]*(n+1) [1] 1 n+1 n 1 for i in range(1,n+1):
    fac[i] = fac[i-1]*i%mod
    finv[i] = pow(fac[i],mod-2,mod) i range(1,n+1) range 1 n+1 n 1 fac[i] = fac[i-1]*i%mod fac[i] fac i fac[i-1]*i%mod fac[i-1]*i fac[i-1] fac i-1 i 1 i mod finv[i] = pow(fac[i],mod-2,mod) finv[i] finv i pow(fac[i],mod-2,mod) pow fac[i] fac i mod-2 mod 2 mod ans = 0 ans 0 for i in range(min(k+1,n)):
    ans += comb(n,i)*comb(n-1,i)%mod
    ans %= mod i range(min(k+1,n)) range min(k+1,n) min k+1 k 1 n ans += comb(n,i)*comb(n-1,i)%mod ans comb(n,i)*comb(n-1,i)%mod comb(n,i)*comb(n-1,i) comb(n,i) comb n i comb(n-1,i) comb n-1 n 1 i mod ans %= mod ans mod print(ans) print ans k = map(int,input().split()) map(int,input().split()) k mod = 1000000007 1000000007 mod ans %= mod mod ans n,k = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans fac = [1]*(n+1) [1]*(n+1) fac finv = [1]*(n+1) [1]*(n+1) finv ans += comb(n,i)*comb(n-1,i)%mod comb(n,i)*comb(n-1,i)%mod ans def comb(n,k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n]*finv[k]%mod*finv[n-k]%mod def comb(n,k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n]*finv[k]%mod*finv[n-k]%mod comb
n,k = map(int,input().split())
mod = 1000000007
def comb(n,k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n]*finv[k]%mod*finv[n-k]%mod
fac = [1]*(n+1)
finv = [1]*(n+1)
for i in range(1,n+1):
    fac[i] = fac[i-1]*i%mod
    finv[i] = pow(fac[i],mod-2,mod)

ans = 0
for i in range(min(k+1,n)):
    ans += comb(n,i)*comb(n-1,i)%mod
    ans %= mod
print(ans)