n,k=map(int,input().split())
mod=10**9+7
def inv(x):
    return pow(x,mod-2,mod)
N=2*10**5
Fact=[0 for i in range(N+1)]
Finv=[0 for i in range(N+1)]
Fact[0]=1
for i in range(N):
    Fact[i+1]=(Fact[i]*(i+1))%mod
Finv[N]=inv(Fact[N])
for i in range(N-1,-1,-1):
    Finv[i]=((i+1)*Finv[i+1])%mod
def C(a,b):
    return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod
ans=0
for i in range(min(n,k+1)):
    ans+=(C(n,i)*C(n-1,i))%mod
    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 def inv(x):
    return pow(x,mod-2,mod) inv return pow(x,mod-2,mod) pow(x,mod-2,mod) pow x mod-2 mod 2 mod x x N=2*10**5 N 2*10**5 2 10**5 10 5 0 for i in range(N+1) for i in range(N+1) i range(N+1) range N+1 N 1 for i in range(N+1) 0 Fact=[0 for i in range(N+1)] Fact [0 for i in range(N+1)] 0 for i in range(N+1) for i in range(N+1) i range(N+1) range N+1 N 1 for i in range(N+1) 0 Finv=[0 for i in range(N+1)] Finv [0 for i in range(N+1)] Fact[0]=1 Fact[0] Fact 0 1 for i in range(N):
    Fact[i+1]=(Fact[i]*(i+1))%mod i range(N) range N Fact[i+1]=(Fact[i]*(i+1))%mod Fact[i+1] Fact i+1 i 1 (Fact[i]*(i+1))%mod Fact[i]*(i+1) Fact[i] Fact i i+1 i 1 mod Finv[N]=inv(Fact[N]) Finv[N] Finv N inv(Fact[N]) inv Fact[N] Fact N for i in range(N-1,-1,-1):
    Finv[i]=((i+1)*Finv[i+1])%mod i range(N-1,-1,-1) range N-1 N 1 -1 -1 Finv[i]=((i+1)*Finv[i+1])%mod Finv[i] Finv i ((i+1)*Finv[i+1])%mod (i+1)*Finv[i+1] i+1 i 1 Finv[i+1] Finv i+1 i 1 mod def C(a,b):
    return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod C return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod Fact[a]*(Finv[b]*Finv[a-b])%mod Fact[a]*(Finv[b]*Finv[a-b]) Fact[a] Fact a Finv[b]*Finv[a-b] Finv[b] Finv b Finv[a-b] Finv a-b a b mod mod a a b b ans=0 ans 0 for i in range(min(n,k+1)):
    ans+=(C(n,i)*C(n-1,i))%mod
    ans%=mod i range(min(n,k+1)) range min(n,k+1) min n k+1 k 1 ans+=(C(n,i)*C(n-1,i))%mod ans (C(n,i)*C(n-1,i))%mod C(n,i)*C(n-1,i) C(n,i) C n i C(n-1,i) C n-1 n 1 i mod ans%=mod ans mod print(ans) print ans mod=10**9+7 10**9+7 mod def inv(x):
    return pow(x,mod-2,mod) def inv(x):
    return pow(x,mod-2,mod) inv n,k=map(int,input().split()) map(int,input().split()) n Finv=[0 for i in range(N+1)] [0 for i in range(N+1)] Finv ans=0 0 ans N=2*10**5 2*10**5 N def C(a,b):
    return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod def C(a,b):
    return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod C ans%=mod mod ans ans+=(C(n,i)*C(n-1,i))%mod (C(n,i)*C(n-1,i))%mod ans k=map(int,input().split()) map(int,input().split()) k Fact=[0 for i in range(N+1)] [0 for i in range(N+1)] Fact
n,k=map(int,input().split())
mod=10**9+7
def inv(x):
    return pow(x,mod-2,mod)
N=2*10**5
Fact=[0 for i in range(N+1)]
Finv=[0 for i in range(N+1)]
Fact[0]=1
for i in range(N):
    Fact[i+1]=(Fact[i]*(i+1))%mod
Finv[N]=inv(Fact[N])
for i in range(N-1,-1,-1):
    Finv[i]=((i+1)*Finv[i+1])%mod
def C(a,b):
    return (Fact[a]*(Finv[b]*Finv[a-b])%mod)%mod
ans=0
for i in range(min(n,k+1)):
    ans+=(C(n,i)*C(n-1,i))%mod
    ans%=mod
print(ans)
