n, k = map(int, input().split())
mod = 10**9+7

R = 200010
f = [1]*R
p = 1
for i in range(1, R):
    p = f[i] = p*i%mod

finv = [1]*R
p = finv[-1] = pow(f[-1], mod-2, mod)
for i in range(R-2, 0, -1):
    p = finv[i] = p*(i+1)%mod

def comb(n, k):
    return f[n]*finv[n-k]*finv[k]%mod

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

print(ans%mod) 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 R = 200010 R 200010 f = [1]*R f [1]*R [1] 1 R p = 1 p 1 for i in range(1, R):
    p = f[i] = p*i%mod i range(1, R) range 1 R p = f[i] = p*i%mod p p*i%mod p*i p i mod = f[i] = p*i%mod f[i] f i p*i%mod finv = [1]*R finv [1]*R [1] 1 R p = finv[-1] = pow(f[-1], mod-2, mod) p pow(f[-1], mod-2, mod) pow f[-1] f -1 mod-2 mod 2 mod = finv[-1] = pow(f[-1], mod-2, mod) finv[-1] finv -1 pow(f[-1], mod-2, mod) for i in range(R-2, 0, -1):
    p = finv[i] = p*(i+1)%mod i range(R-2, 0, -1) range R-2 R 2 0 -1 p = finv[i] = p*(i+1)%mod p p*(i+1)%mod p*(i+1) p i+1 i 1 mod = finv[i] = p*(i+1)%mod finv[i] finv i p*(i+1)%mod def comb(n, k):
    return f[n]*finv[n-k]*finv[k]%mod comb return f[n]*finv[n-k]*finv[k]%mod f[n]*finv[n-k]*finv[k]%mod f[n]*finv[n-k]*finv[k] f[n]*finv[n-k] f[n] f n finv[n-k] finv n-k n k finv[k] finv k mod n n k k ans = 0 ans 0 for m in range(min(k, n-1)+1):
    x = comb(n, m)
    y = comb(n-1, m)
    ans += x*y%mod m range(min(k, n-1)+1) range min(k, n-1)+1 min(k, n-1) min k n-1 n 1 1 x = comb(n, m) x comb(n, m) comb n m y = comb(n-1, m) y comb(n-1, m) comb n-1 n 1 m ans += x*y%mod ans x*y%mod x*y x y mod print(ans%mod) print ans%mod ans mod p = f[i] = p*i%mod p*i%mod p p = 1 1 p f = [1]*R [1]*R f y = comb(n-1, m) comb(n-1, m) y mod = 10**9+7 10**9+7 mod finv = [1]*R [1]*R finv ans = 0 0 ans k = map(int, input().split()) map(int, input().split()) k R = 200010 200010 R p = finv[i] = p*(i+1)%mod p*(i+1)%mod p n, k = map(int, input().split()) map(int, input().split()) n def comb(n, k):
    return f[n]*finv[n-k]*finv[k]%mod def comb(n, k):
    return f[n]*finv[n-k]*finv[k]%mod comb x = comb(n, m) comb(n, m) x p = finv[-1] = pow(f[-1], mod-2, mod) pow(f[-1], mod-2, mod) p ans += x*y%mod x*y%mod ans
n, k = map(int, input().split())
mod = 10**9+7

R = 200010
f = [1]*R
p = 1
for i in range(1, R):
    p = f[i] = p*i%mod

finv = [1]*R
p = finv[-1] = pow(f[-1], mod-2, mod)
for i in range(R-2, 0, -1):
    p = finv[i] = p*(i+1)%mod

def comb(n, k):
    return f[n]*finv[n-k]*finv[k]%mod

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

print(ans%mod)