n,k=map(int,input().split())
mod=1000000007

fac = [1]*(n+1)
inv = [1]*(n+1)
for i in range(2,n+1):
    fac[i] = fac[i-1]*i % mod
    inv[i] = pow(fac[i],mod-2,mod)

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

fac = [1]*(n+1)
inv = [1]*(n+1)
for i in range(2,n+1):
    fac[i] = fac[i-1]*i % mod
    inv[i] = pow(fac[i],mod-2,mod)

def nCk(n,k):
    return fac[n]*inv[k]%mod*inv[n-k]%mod
ans = 0
for i in range(min(k+1,n)):
    ans += nCk(n,i)*nCk(n-1,i)%mod
    ans %=mod
print(ans)