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

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

count = 0
for i in range(min(n, k+1)):
  c = fact[n] * invf[n-i] * invf[i] % mod
  count += c * fact[n-1] * invf[n-i-1] * invf[i] % mod
  count %= mod
print(count) mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k fact = [1] * (2 * n + 1) fact [1] * (2 * n + 1) [1] 1 2 * n + 1 2 * n 2 n 1 inv = [1] * (2 * n + 1) inv [1] * (2 * n + 1) [1] 1 2 * n + 1 2 * n 2 n 1 invf = [1] * (2 * n + 1) invf [1] * (2 * n + 1) [1] 1 2 * n + 1 2 * n 2 n 1 for i in range(2, 2 * n + 1):
  fact[i] = fact[i-1] * i % mod
  inv[i] = -inv[mod % i] * (mod // i) % mod
  invf[i] = invf[i-1] * inv[i] % mod i range(2, 2 * n + 1) range 2 2 * n + 1 2 * n 2 n 1 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] = -inv[mod % i] * (mod // i) % mod inv[i] inv i -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 invf[i] = invf[i-1] * inv[i] % mod invf[i] invf i invf[i-1] * inv[i] % mod invf[i-1] * inv[i] invf[i-1] invf i-1 i 1 inv[i] inv i mod count = 0 count 0 for i in range(min(n, k+1)):
  c = fact[n] * invf[n-i] * invf[i] % mod
  count += c * fact[n-1] * invf[n-i-1] * invf[i] % mod
  count %= mod i range(min(n, k+1)) range min(n, k+1) min n k+1 k 1 c = fact[n] * invf[n-i] * invf[i] % mod c fact[n] * invf[n-i] * invf[i] % mod fact[n] * invf[n-i] * invf[i] fact[n] * invf[n-i] fact[n] fact n invf[n-i] invf n-i n i invf[i] invf i mod count += c * fact[n-1] * invf[n-i-1] * invf[i] % mod count c * fact[n-1] * invf[n-i-1] * invf[i] % mod c * fact[n-1] * invf[n-i-1] * invf[i] c * fact[n-1] * invf[n-i-1] c * fact[n-1] c fact[n-1] fact n-1 n 1 invf[n-i-1] invf n-i-1 n-i n i 1 invf[i] invf i mod count %= mod count mod print(count) print count fact = [1] * (2 * n + 1) [1] * (2 * n + 1) fact n, k = map(int, input().split()) map(int, input().split()) n k = map(int, input().split()) map(int, input().split()) k inv = [1] * (2 * n + 1) [1] * (2 * n + 1) inv mod = 10 ** 9 + 7 10 ** 9 + 7 mod count += c * fact[n-1] * invf[n-i-1] * invf[i] % mod c * fact[n-1] * invf[n-i-1] * invf[i] % mod count count = 0 0 count invf = [1] * (2 * n + 1) [1] * (2 * n + 1) invf count %= mod mod count c = fact[n] * invf[n-i] * invf[i] % mod fact[n] * invf[n-i] * invf[i] % mod c
mod = 10 ** 9 + 7
n, k = map(int, input().split())

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

count = 0
for i in range(min(n, k+1)):
  c = fact[n] * invf[n-i] * invf[i] % mod
  count += c * fact[n-1] * invf[n-i-1] * invf[i] % mod
  count %= mod
print(count)