n, k = map(int, input().split())
k = min(n - 1, k)

mod = 10 ** 9 + 7
fact = [1] * (n + 1)
ifact = [1] * (n + 1)

for i in range(n):
    fact[i + 1] = fact[i] * (i + 1) % mod
    ifact[i + 1] = pow(fact[i + 1], mod - 2, mod)


def comb(x, y):
    if y < 0 or y > x:
        return 0
    return (fact[x] * ifact[x - y] * ifact[y]) % mod


ans = 0
for i in range(k + 1):
    ans += comb(n, i) * comb(n - 1, n - i - 1) % mod
    ans %= mod
print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k k = min(n - 1, k) k min(n - 1, k) min n - 1 n 1 k mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 fact = [1] * (n + 1) fact [1] * (n + 1) [1] 1 n + 1 n 1 ifact = [1] * (n + 1) ifact [1] * (n + 1) [1] 1 n + 1 n 1 for i in range(n):
    fact[i + 1] = fact[i] * (i + 1) % mod
    ifact[i + 1] = pow(fact[i + 1], mod - 2, mod) i range(n) range n fact[i + 1] = fact[i] * (i + 1) % mod fact[i + 1] fact i + 1 i 1 fact[i] * (i + 1) % mod fact[i] * (i + 1) fact[i] fact i i + 1 i 1 mod ifact[i + 1] = pow(fact[i + 1], mod - 2, mod) ifact[i + 1] ifact i + 1 i 1 pow(fact[i + 1], mod - 2, mod) pow fact[i + 1] fact i + 1 i 1 mod - 2 mod 2 mod def comb(x, y):
    if y < 0 or y > x:
        return 0
    return (fact[x] * ifact[x - y] * ifact[y]) % mod comb if y < 0 or y > x:
        return 0
     y < 0 or y > x y < 0 y 0 y > x y x return 0 0 return (fact[x] * ifact[x - y] * ifact[y]) % mod (fact[x] * ifact[x - y] * ifact[y]) % mod fact[x] * ifact[x - y] * ifact[y] fact[x] * ifact[x - y] fact[x] fact x ifact[x - y] ifact x - y x y ifact[y] ifact y mod x x y y ans = 0 ans 0 for i in range(k + 1):
    ans += comb(n, i) * comb(n - 1, n - i - 1) % mod
    ans %= mod i range(k + 1) range k + 1 k 1 ans += comb(n, i) * comb(n - 1, n - i - 1) % mod ans comb(n, i) * comb(n - 1, n - i - 1) % mod comb(n, i) * comb(n - 1, n - i - 1) comb(n, i) comb n i comb(n - 1, n - i - 1) comb n - 1 n 1 n - i - 1 n - i n i 1 mod ans %= mod ans mod print(ans) print ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod k = map(int, input().split()) map(int, input().split()) k def comb(x, y):
    if y < 0 or y > x:
        return 0
    return (fact[x] * ifact[x - y] * ifact[y]) % mod def comb(x, y):
    if y < 0 or y > x:
        return 0
    return (fact[x] * ifact[x - y] * ifact[y]) % mod comb ans %= mod mod ans k = min(n - 1, k) min(n - 1, k) k ifact = [1] * (n + 1) [1] * (n + 1) ifact fact = [1] * (n + 1) [1] * (n + 1) fact ans += comb(n, i) * comb(n - 1, n - i - 1) % mod comb(n, i) * comb(n - 1, n - i - 1) % mod ans n, k = map(int, input().split()) map(int, input().split()) n ans = 0 0 ans
n, k = map(int, input().split())
k = min(n - 1, k)

mod = 10 ** 9 + 7
fact = [1] * (n + 1)
ifact = [1] * (n + 1)

for i in range(n):
    fact[i + 1] = fact[i] * (i + 1) % mod
    ifact[i + 1] = pow(fact[i + 1], mod - 2, mod)


def comb(x, y):
    if y < 0 or y > x:
        return 0
    return (fact[x] * ifact[x - y] * ifact[y]) % mod


ans = 0
for i in range(k + 1):
    ans += comb(n, i) * comb(n - 1, n - i - 1) % mod
    ans %= mod
print(ans)
