N, K = list(map(int, input().split()))
p = 10**9+7
size = 2*2*10**5

def binom(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
 
for i in range(2, size + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

res = 0

for i in range(min(K, N)+1):
        res += (binom(N, i, p) * binom(N-1, N-i-1, p)) % p

print(res % p) 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 p = 10**9+7 p 10**9+7 10**9 10 9 7 size = 2*2*10**5 size 2*2*10**5 2*2 2 2 10**5 10 5 def binom(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p binom if (r < 0) or (n < r):
        return 0
     (r < 0) or (n < r) r < 0 r 0 n < r n r return 0 0 r = min(r, n - r) r min(r, n - r) min r n - r n r return fact[n] * factinv[r] * factinv[n-r] % p fact[n] * factinv[r] * factinv[n-r] % p fact[n] * factinv[r] * factinv[n-r] fact[n] * factinv[r] fact[n] fact n factinv[r] factinv r factinv[n-r] factinv n-r n r p n n r r p p fact = [1, 1] fact [1, 1] 1 1 factinv = [1, 1] factinv [1, 1] 1 1 inv = [0, 1] inv [0, 1] 0 1 for i in range(2, size + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p) i range(2, size + 1) range 2 size + 1 size 1 fact.append((fact[-1] * i) % p) fact.append fact append (fact[-1] * i) % p fact[-1] * i fact[-1] fact -1 i p inv.append((-inv[p % i] * (p // i)) % p) inv.append inv append (-inv[p % i] * (p // i)) % p -inv[p % i] * (p // i) -inv[p % i] inv[p % i] inv p % i p i p // i p i p factinv.append((factinv[-1] * inv[-1]) % p) factinv.append factinv append (factinv[-1] * inv[-1]) % p factinv[-1] * inv[-1] factinv[-1] factinv -1 inv[-1] inv -1 p res = 0 res 0 for i in range(min(K, N)+1):
        res += (binom(N, i, p) * binom(N-1, N-i-1, p)) % p i range(min(K, N)+1) range min(K, N)+1 min(K, N) min K N 1 res += (binom(N, i, p) * binom(N-1, N-i-1, p)) % p res (binom(N, i, p) * binom(N-1, N-i-1, p)) % p binom(N, i, p) * binom(N-1, N-i-1, p) binom(N, i, p) binom N i p binom(N-1, N-i-1, p) binom N-1 N 1 N-i-1 N-i N i 1 p p print(res % p) print res % p res p size = 2*2*10**5 2*2*10**5 size def binom(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p def binom(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p binom factinv = [1, 1] [1, 1] factinv inv = [0, 1] [0, 1] inv K = list(map(int, input().split())) list(map(int, input().split())) K res += (binom(N, i, p) * binom(N-1, N-i-1, p)) % p (binom(N, i, p) * binom(N-1, N-i-1, p)) % p res fact = [1, 1] [1, 1] fact p = 10**9+7 10**9+7 p N, K = list(map(int, input().split())) list(map(int, input().split())) N res = 0 0 res
N, K = list(map(int, input().split()))
p = 10**9+7
size = 2*2*10**5

def binom(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
 
for i in range(2, size + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

res = 0

for i in range(min(K, N)+1):
        res += (binom(N, i, p) * binom(N-1, N-i-1, p)) % p

print(res % p)