n, k = list(map(int, input().split()))
mod = 1000000007
fac = [1]
inv = [1]
for i in range(n * 2):
    fac.append(fac[-1] * (i + 1) % mod)
    inv.append(pow(fac[-1], mod - 2, mod))


def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return ((fac[n] * inv[k]) % mod * inv[n - k]) % mod


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


def cmb(n, k):
    if k < 0 or k > n:
        return 0
    return ((fac[n] * inv[k]) % mod * inv[n - k]) % mod


ret = 0
for m in range(min(k + 1, n)):
    ret = (ret + (cmb(n, m) * cmb(n - 1, n - m - 1)) % mod) % mod
print(ret)
