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

SIZE = 2 * 10 ** 5 + 1
fact = [0] * SIZE
inv = [0] * SIZE
finv = [0] * SIZE
fact[0], fact[1] = 1, 1
inv[1] = 1
finv[0], finv[1] = 1, 1
for i in range(2, SIZE):
    fact[i] = fact[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod


def nCr(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % mod) % mod


ans = 1
limit = min(k+1, n)
for i in range(1, limit):
    vacant = i
    fill = n-i
    add = i
    pattern = nCr(n, vacant) * nCr(add+fill-1, add)
    ans = (ans + pattern) % 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 SIZE = 2 * 10 ** 5 + 1 SIZE 2 * 10 ** 5 + 1 2 * 10 ** 5 2 10 ** 5 10 5 1 fact = [0] * SIZE fact [0] * SIZE [0] 0 SIZE inv = [0] * SIZE inv [0] * SIZE [0] 0 SIZE finv = [0] * SIZE finv [0] * SIZE [0] 0 SIZE fact[0], fact[1] = 1, 1 fact[0] fact 0 1 fact[1] fact 1 1 inv[1] = 1 inv[1] inv 1 1 finv[0], finv[1] = 1, 1 finv[0] finv 0 1 finv[1] finv 1 1 for i in range(2, SIZE):
    fact[i] = fact[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod i range(2, SIZE) range 2 SIZE fact[i] = fact[i - 1] * i % mod fact[i] fact i fact[i - 1] * i % mod fact[i - 1] * i fact[i - 1] fact i - 1 i 1 i mod inv[i] = mod - inv[mod % i] * (mod // i) % mod inv[i] inv i mod - inv[mod % i] * (mod // i) % mod mod inv[mod % i] * (mod // i) % mod inv[mod % i] * (mod // i) inv[mod % i] inv mod % i mod i mod // i mod i mod finv[i] = finv[i - 1] * inv[i] % mod finv[i] finv i finv[i - 1] * inv[i] % mod finv[i - 1] * inv[i] finv[i - 1] finv i - 1 i 1 inv[i] inv i mod def nCr(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % mod) % mod nCr if n < 0 or r < 0 or n < r:
        return 0
     n < 0 or r < 0 or n < r n < 0 or r < 0 n < 0 n 0 r < 0 r 0 n < r n r return 0 0 return fact[n] * (finv[r] * finv[n - r] % mod) % mod fact[n] * (finv[r] * finv[n - r] % mod) % mod fact[n] * (finv[r] * finv[n - r] % mod) fact[n] fact n finv[r] * finv[n - r] % mod finv[r] * finv[n - r] finv[r] finv r finv[n - r] finv n - r n r mod mod n n r r ans = 1 ans 1 limit = min(k+1, n) limit min(k+1, n) min k+1 k 1 n for i in range(1, limit):
    vacant = i
    fill = n-i
    add = i
    pattern = nCr(n, vacant) * nCr(add+fill-1, add)
    ans = (ans + pattern) % mod i range(1, limit) range 1 limit vacant = i vacant i fill = n-i fill n-i n i add = i add i pattern = nCr(n, vacant) * nCr(add+fill-1, add) pattern nCr(n, vacant) * nCr(add+fill-1, add) nCr(n, vacant) nCr n vacant nCr(add+fill-1, add) nCr add+fill-1 add+fill add fill 1 add ans = (ans + pattern) % mod ans (ans + pattern) % mod ans + pattern ans pattern mod print(ans) print ans k = map(int, input().split()) map(int, input().split()) k pattern = nCr(n, vacant) * nCr(add+fill-1, add) nCr(n, vacant) * nCr(add+fill-1, add) pattern fact = [0] * SIZE [0] * SIZE fact inv = [0] * SIZE [0] * SIZE inv add = i i add fill = n-i n-i fill vacant = i i vacant finv = [0] * SIZE [0] * SIZE finv mod = 10**9 + 7 10**9 + 7 mod limit = min(k+1, n) min(k+1, n) limit def nCr(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % mod) % mod def nCr(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % mod) % mod nCr SIZE = 2 * 10 ** 5 + 1 2 * 10 ** 5 + 1 SIZE n, k = map(int, input().split()) map(int, input().split()) n ans = (ans + pattern) % mod (ans + pattern) % mod ans ans = 1 1 ans
n, k = map(int, input().split())
mod = 10**9 + 7

SIZE = 2 * 10 ** 5 + 1
fact = [0] * SIZE
inv = [0] * SIZE
finv = [0] * SIZE
fact[0], fact[1] = 1, 1
inv[1] = 1
finv[0], finv[1] = 1, 1
for i in range(2, SIZE):
    fact[i] = fact[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod


def nCr(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % mod) % mod


ans = 1
limit = min(k+1, n)
for i in range(1, limit):
    vacant = i
    fill = n-i
    add = i
    pattern = nCr(n, vacant) * nCr(add+fill-1, add)
    ans = (ans + pattern) % mod

print(ans)