N, K = map(int, input().split())

MOD = 10**9+7
fac = [1]*(N+1)
rev = [1]*(N+1)
 
for i in range(1, N+1):
  fac[i] = i*fac[i-1]%MOD
  rev[i] = pow(fac[i], MOD-2, MOD)

comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD
ans = 0

for i in range(1+min(N-1, K)):
  ans += comb(N, i) * comb(N-1, 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 fac = [1]*(N+1) fac [1]*(N+1) [1] 1 N+1 N 1 rev = [1]*(N+1) rev [1]*(N+1) [1] 1 N+1 N 1 for i in range(1, N+1):
  fac[i] = i*fac[i-1]%MOD
  rev[i] = pow(fac[i], MOD-2, MOD) i range(1, N+1) range 1 N+1 N 1 fac[i] = i*fac[i-1]%MOD fac[i] fac i i*fac[i-1]%MOD i*fac[i-1] i fac[i-1] fac i-1 i 1 MOD rev[i] = pow(fac[i], MOD-2, MOD) rev[i] rev i pow(fac[i], MOD-2, MOD) pow fac[i] fac i MOD-2 MOD 2 MOD comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD comb lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD (fac[a]*rev[a-b]*rev[b])%MOD fac[a]*rev[a-b]*rev[b] fac[a]*rev[a-b] fac[a] fac a rev[a-b] rev a-b a b rev[b] rev b MOD a b ans = 0 ans 0 for i in range(1+min(N-1, K)):
  ans += comb(N, i) * comb(N-1, i) i range(1+min(N-1, K)) range 1+min(N-1, K) 1 min(N-1, K) min N-1 N 1 K ans += comb(N, i) * comb(N-1, i) ans comb(N, i) * comb(N-1, i) comb(N, i) comb N i comb(N-1, i) comb N-1 N 1 i ans %= MOD ans MOD print(ans) print ans MOD = 10**9+7 10**9+7 MOD ans = 0 0 ans comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD comb ans += comb(N, i) * comb(N-1, i) comb(N, i) * comb(N-1, i) ans ans %= MOD MOD ans K = map(int, input().split()) map(int, input().split()) K fac = [1]*(N+1) [1]*(N+1) fac rev = [1]*(N+1) [1]*(N+1) rev N, K = map(int, input().split()) map(int, input().split()) N
N, K = map(int, input().split())

MOD = 10**9+7
fac = [1]*(N+1)
rev = [1]*(N+1)
 
for i in range(1, N+1):
  fac[i] = i*fac[i-1]%MOD
  rev[i] = pow(fac[i], MOD-2, MOD)

comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD
ans = 0

for i in range(1+min(N-1, K)):
  ans += comb(N, i) * comb(N-1, i)
ans %= MOD
print(ans)
