n, K = map(int,input().split())

MOD = 10**9 + 7
fac = [1 for k in range(200010)]
inv = [1 for k in range(200010)]
finv = [1 for k in range(200010)]
for k in range(2,200010):
    fac[k] = (fac[k-1]*k)%MOD
    inv[k] = (MOD - inv[MOD%k] * (MOD // k))%MOD
    finv[k] = (finv[k - 1] * inv[k]) % MOD;
def nCr(n,r):
    return (fac[n]*finv[r]*finv[n-r])%MOD

ans = 0
for i in range(min(n,K+1)):
    ans += nCr(n,i)*nCr(n-1,n-i-1)
    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 1 for k in range(200010) for k in range(200010) k range(200010) range 200010 for k in range(200010) 1 fac = [1 for k in range(200010)] fac [1 for k in range(200010)] 1 for k in range(200010) for k in range(200010) k range(200010) range 200010 for k in range(200010) 1 inv = [1 for k in range(200010)] inv [1 for k in range(200010)] 1 for k in range(200010) for k in range(200010) k range(200010) range 200010 for k in range(200010) 1 finv = [1 for k in range(200010)] finv [1 for k in range(200010)] for k in range(2,200010):
    fac[k] = (fac[k-1]*k)%MOD
    inv[k] = (MOD - inv[MOD%k] * (MOD // k))%MOD
    finv[k] = (finv[k - 1] * inv[k]) % MOD; k range(2,200010) range 2 200010 fac[k] = (fac[k-1]*k)%MOD fac[k] fac k (fac[k-1]*k)%MOD fac[k-1]*k fac[k-1] fac k-1 k 1 k MOD inv[k] = (MOD - inv[MOD%k] * (MOD // k))%MOD inv[k] inv k (MOD - inv[MOD%k] * (MOD // k))%MOD MOD - inv[MOD%k] * (MOD // k) MOD inv[MOD%k] * (MOD // k) inv[MOD%k] inv MOD%k MOD k MOD // k MOD k MOD finv[k] = (finv[k - 1] * inv[k]) % MOD finv[k] finv k (finv[k - 1] * inv[k]) % MOD finv[k - 1] * inv[k] finv[k - 1] finv k - 1 k 1 inv[k] inv k MOD def nCr(n,r):
    return (fac[n]*finv[r]*finv[n-r])%MOD nCr return (fac[n]*finv[r]*finv[n-r])%MOD (fac[n]*finv[r]*finv[n-r])%MOD fac[n]*finv[r]*finv[n-r] fac[n]*finv[r] fac[n] fac n finv[r] finv r finv[n-r] finv n-r n r MOD n n r r ans = 0 ans 0 for i in range(min(n,K+1)):
    ans += nCr(n,i)*nCr(n-1,n-i-1)
    ans %= MOD i range(min(n,K+1)) range min(n,K+1) min n K+1 K 1 ans += nCr(n,i)*nCr(n-1,n-i-1) ans nCr(n,i)*nCr(n-1,n-i-1) nCr(n,i) nCr n i nCr(n-1,n-i-1) nCr n-1 n 1 n-i-1 n-i n i 1 ans %= MOD ans MOD print(ans) print ans n, K = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans MOD = 10**9 + 7 10**9 + 7 MOD inv = [1 for k in range(200010)] [1 for k in range(200010)] inv def nCr(n,r):
    return (fac[n]*finv[r]*finv[n-r])%MOD def nCr(n,r):
    return (fac[n]*finv[r]*finv[n-r])%MOD nCr ans += nCr(n,i)*nCr(n-1,n-i-1) nCr(n,i)*nCr(n-1,n-i-1) ans finv = [1 for k in range(200010)] [1 for k in range(200010)] finv fac = [1 for k in range(200010)] [1 for k in range(200010)] fac K = map(int,input().split()) map(int,input().split()) K ans %= MOD MOD ans
n, K = map(int,input().split())

MOD = 10**9 + 7
fac = [1 for k in range(200010)]
inv = [1 for k in range(200010)]
finv = [1 for k in range(200010)]
for k in range(2,200010):
    fac[k] = (fac[k-1]*k)%MOD
    inv[k] = (MOD - inv[MOD%k] * (MOD // k))%MOD
    finv[k] = (finv[k - 1] * inv[k]) % MOD;
def nCr(n,r):
    return (fac[n]*finv[r]*finv[n-r])%MOD

ans = 0
for i in range(min(n,K+1)):
    ans += nCr(n,i)*nCr(n-1,n-i-1)
    ans %= MOD

print(ans)
