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

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

if n-1 <= k:
    print((fact[2*n-1] * finv[n] * finv[n-1]) % mod)
    exit()

ans = 0
for i in range(k+1):
    ans += fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i]
    ans %= 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 fact = [1] fact [1] 1 finv = [1] finv [1] 1 for i in range(1, 2*n):
    fact.append((fact[i-1] * i) % mod)
    finv.append(pow(fact[i], mod-2, mod)) i range(1, 2*n) range 1 2*n 2 n fact.append((fact[i-1] * i) % mod) fact.append fact append (fact[i-1] * i) % mod fact[i-1] * i fact[i-1] fact i-1 i 1 i mod finv.append(pow(fact[i], mod-2, mod)) finv.append finv append pow(fact[i], mod-2, mod) pow fact[i] fact i mod-2 mod 2 mod if n-1 <= k:
    print((fact[2*n-1] * finv[n] * finv[n-1]) % mod)
    exit() n-1 <= k n-1 n 1 k print((fact[2*n-1] * finv[n] * finv[n-1]) % mod) print (fact[2*n-1] * finv[n] * finv[n-1]) % mod fact[2*n-1] * finv[n] * finv[n-1] fact[2*n-1] * finv[n] fact[2*n-1] fact 2*n-1 2*n 2 n 1 finv[n] finv n finv[n-1] finv n-1 n 1 mod exit() exit ans = 0 ans 0 for i in range(k+1):
    ans += fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i]
    ans %= mod i range(k+1) range k+1 k 1 ans += fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i] ans fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i] fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] fact[n] * finv[n-i] * finv[i] * fact[n-1] fact[n] * finv[n-i] * finv[i] fact[n] * finv[n-i] fact[n] fact n finv[n-i] finv n-i n i finv[i] finv i fact[n-1] fact n-1 n 1 finv[n-1-i] finv n-1-i n-1 n 1 i finv[i] finv i ans %= mod ans mod print(ans) print ans ans %= mod mod ans ans = 0 0 ans finv = [1] [1] finv k = map(int,input().split()) map(int,input().split()) k mod = 10**9 + 7 10**9 + 7 mod fact = [1] [1] fact n,k = map(int,input().split()) map(int,input().split()) n ans += fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i] fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i] ans
n,k = map(int,input().split())
mod = 10**9 + 7

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

if n-1 <= k:
    print((fact[2*n-1] * finv[n] * finv[n-1]) % mod)
    exit()

ans = 0
for i in range(k+1):
    ans += fact[n] * finv[n-i] * finv[i] * fact[n-1] * finv[n-1-i] * finv[i]
    ans %= mod

print(ans)