n, k = map(int, input().split())
mod = 10 ** 9 + 7
def comb(n, r):
    if n < r:return 0
    if n < 0 or k < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod
fa = [1] * (n + 1)
fi = [1] * (n + 1)
for i in range(1, n + 1):
    fa[i] = fa[i - 1] * i % mod
    fi[i] = pow(fa[i], mod - 2, mod)
ans = 0
for i in range(min(k, n - 1) + 1):
    ans += comb(n, i) * comb(n - 1, i) % 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 def comb(n, r):
    if n < r:return 0
    if n < 0 or k < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod comb if n < r:return 0
     n < r n r if n < 0 or k < 0:return 0
     n < 0 or k < 0 n < 0 n 0 k < 0 k 0 return fa[n] * fi[r] % mod * fi[n - r] % mod fa[n] * fi[r] % mod * fi[n - r] % mod fa[n] * fi[r] % mod * fi[n - r] fa[n] * fi[r] % mod fa[n] * fi[r] fa[n] fa n fi[r] fi r mod fi[n - r] fi n - r n r mod n n r r fa = [1] * (n + 1) fa [1] * (n + 1) [1] 1 n + 1 n 1 fi = [1] * (n + 1) fi [1] * (n + 1) [1] 1 n + 1 n 1 for i in range(1, n + 1):
    fa[i] = fa[i - 1] * i % mod
    fi[i] = pow(fa[i], mod - 2, mod) i range(1, n + 1) range 1 n + 1 n 1 fa[i] = fa[i - 1] * i % mod fa[i] fa i fa[i - 1] * i % mod fa[i - 1] * i fa[i - 1] fa i - 1 i 1 i mod fi[i] = pow(fa[i], mod - 2, mod) fi[i] fi i pow(fa[i], mod - 2, mod) pow fa[i] fa i mod - 2 mod 2 mod ans = 0 ans 0 for i in range(min(k, n - 1) + 1):
    ans += comb(n, i) * comb(n - 1, i) % mod i range(min(k, n - 1) + 1) range min(k, n - 1) + 1 min(k, n - 1) min k n - 1 n 1 1 ans += comb(n, i) * comb(n - 1, i) % mod ans comb(n, i) * comb(n - 1, i) % mod comb(n, i) * comb(n - 1, i) comb(n, i) comb n i comb(n - 1, i) comb n - 1 n 1 i mod print(ans % mod) print ans % mod ans mod fi = [1] * (n + 1) [1] * (n + 1) fi fa = [1] * (n + 1) [1] * (n + 1) fa ans = 0 0 ans n, k = map(int, input().split()) map(int, input().split()) n k = map(int, input().split()) map(int, input().split()) k def comb(n, r):
    if n < r:return 0
    if n < 0 or k < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod def comb(n, r):
    if n < r:return 0
    if n < 0 or k < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod comb ans += comb(n, i) * comb(n - 1, i) % mod comb(n, i) * comb(n - 1, i) % mod ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod
n, k = map(int, input().split())
mod = 10 ** 9 + 7
def comb(n, r):
    if n < r:return 0
    if n < 0 or k < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod
fa = [1] * (n + 1)
fi = [1] * (n + 1)
for i in range(1, n + 1):
    fa[i] = fa[i - 1] * i % mod
    fi[i] = pow(fa[i], mod - 2, mod)
ans = 0
for i in range(min(k, n - 1) + 1):
    ans += comb(n, i) * comb(n - 1, i) % mod
print(ans % mod)