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

mod = 10 ** 9 + 7

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, n+1):
    fac.append(fac[-1] * i % mod)
    inv.append(-inv[mod%i] * (mod // i) % mod)
    finv.append(finv[-1] * inv[-1] % mod)

ans = 0
for i in range(min(n-1, k) + 1):
    com1 = fac[n] * finv[i] * finv[n-i] % mod
    com2 = fac[n-1] * finv[i] * finv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % 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 fac = [1, 1] fac [1, 1] 1 1 finv = [1, 1] finv [1, 1] 1 1 inv = [0, 1] inv [0, 1] 0 1 for i in range(2, n+1):
    fac.append(fac[-1] * i % mod)
    inv.append(-inv[mod%i] * (mod // i) % mod)
    finv.append(finv[-1] * inv[-1] % mod) i range(2, n+1) range 2 n+1 n 1 fac.append(fac[-1] * i % mod) fac.append fac append fac[-1] * i % mod fac[-1] * i fac[-1] fac -1 i mod inv.append(-inv[mod%i] * (mod // i) % mod) inv.append inv append -inv[mod%i] * (mod // i) % mod -inv[mod%i] * (mod // i) -inv[mod%i] inv[mod%i] inv mod%i mod i mod // i mod i mod finv.append(finv[-1] * inv[-1] % mod) finv.append finv append finv[-1] * inv[-1] % mod finv[-1] * inv[-1] finv[-1] finv -1 inv[-1] inv -1 mod ans = 0 ans 0 for i in range(min(n-1, k) + 1):
    com1 = fac[n] * finv[i] * finv[n-i] % mod
    com2 = fac[n-1] * finv[i] * finv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % mod i range(min(n-1, k) + 1) range min(n-1, k) + 1 min(n-1, k) min n-1 n 1 k 1 com1 = fac[n] * finv[i] * finv[n-i] % mod com1 fac[n] * finv[i] * finv[n-i] % mod fac[n] * finv[i] * finv[n-i] fac[n] * finv[i] fac[n] fac n finv[i] finv i finv[n-i] finv n-i n i mod com2 = fac[n-1] * finv[i] * finv[n-i-1] % mod com2 fac[n-1] * finv[i] * finv[n-i-1] % mod fac[n-1] * finv[i] * finv[n-i-1] fac[n-1] * finv[i] fac[n-1] fac n-1 n 1 finv[i] finv i finv[n-i-1] finv n-i-1 n-i n i 1 mod mul = com1 * com2 % mod mul com1 * com2 % mod com1 * com2 com1 com2 mod ans = (ans + mul) % mod ans (ans + mul) % mod ans + mul ans mul mod print(ans) print ans ans = 0 0 ans mul = com1 * com2 % mod com1 * com2 % mod mul finv = [1, 1] [1, 1] finv fac = [1, 1] [1, 1] fac com1 = fac[n] * finv[i] * finv[n-i] % mod fac[n] * finv[i] * finv[n-i] % mod com1 com2 = fac[n-1] * finv[i] * finv[n-i-1] % mod fac[n-1] * finv[i] * finv[n-i-1] % mod com2 k = map(int, input().split()) map(int, input().split()) k n, k = map(int, input().split()) map(int, input().split()) n mod = 10 ** 9 + 7 10 ** 9 + 7 mod inv = [0, 1] [0, 1] inv ans = (ans + mul) % mod (ans + mul) % mod ans
n, k = map(int, input().split())

mod = 10 ** 9 + 7

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, n+1):
    fac.append(fac[-1] * i % mod)
    inv.append(-inv[mod%i] * (mod // i) % mod)
    finv.append(finv[-1] * inv[-1] % mod)

ans = 0
for i in range(min(n-1, k) + 1):
    com1 = fac[n] * finv[i] * finv[n-i] % mod
    com2 = fac[n-1] * finv[i] * finv[n-i-1] % mod
    mul = com1 * com2 % mod
    ans = (ans + mul) % mod

print(ans)