n,k=map(int,input().split())
P=10**9+7
class FactInv:
    def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
    def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P
C=FactInv(2*n+10,P)
ans=0
for i in range(0,min(k+1,n)):
    ans+=(C.comb(n,i)*C.comb(n-1,n-i-1))%P
    ans%=P
print(ans) n,k=map(int,input().split()) n 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 class FactInv:
    def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
    def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P FactInv def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
     __init__ fact=[] fact [] ifact=[] ifact [] fact=[1]*(N+1) fact [1]*(N+1) [1] 1 N+1 N 1 ifact=[0]*(N+1) ifact [0]*(N+1) [0] 0 N+1 N 1 for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
         i range(1,N) range 1 N fact[i+1]=(fact[i]*(i+1))%P fact[i+1] fact i+1 i 1 (fact[i]*(i+1))%P fact[i]*(i+1) fact[i] fact i i+1 i 1 P ifact[-1]=pow(fact[-1],P-2,P) ifact[-1] ifact -1 pow(fact[-1],P-2,P) pow fact[-1] fact -1 P-2 P 2 P for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
         i range(N,0,-1) range N 0 -1 ifact[i-1]=(ifact[i]*i)%P ifact[i-1] ifact i-1 i 1 (ifact[i]*i)%P ifact[i]*i ifact[i] ifact i i P self.fact=fact self.fact self fact fact self.ifact=ifact self.ifact self ifact ifact self.P=P self.P self P P self self N N P P def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P comb return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P self.fact[n]*self.ifact[k]*self.ifact[n-k] self.fact[n]*self.ifact[k] self.fact[n] self.fact self fact n self.ifact[k] self.ifact self ifact k self.ifact[n-k] self.ifact self ifact n-k n k self.P self P self self n n k k C=FactInv(2*n+10,P) C FactInv(2*n+10,P) FactInv 2*n+10 2*n 2 n 10 P ans=0 ans 0 for i in range(0,min(k+1,n)):
    ans+=(C.comb(n,i)*C.comb(n-1,n-i-1))%P
    ans%=P i range(0,min(k+1,n)) range 0 min(k+1,n) min k+1 k 1 n ans+=(C.comb(n,i)*C.comb(n-1,n-i-1))%P ans (C.comb(n,i)*C.comb(n-1,n-i-1))%P C.comb(n,i)*C.comb(n-1,n-i-1) C.comb(n,i) C.comb C comb n i C.comb(n-1,n-i-1) C.comb C comb n-1 n 1 n-i-1 n-i n i 1 P ans%=P ans P print(ans) print ans ans+=(C.comb(n,i)*C.comb(n-1,n-i-1))%P (C.comb(n,i)*C.comb(n-1,n-i-1))%P ans class FactInv:
    def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
    def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P class FactInv:
    def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
    def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P FactInv C=FactInv(2*n+10,P) FactInv(2*n+10,P) C ans=0 0 ans n,k=map(int,input().split()) map(int,input().split()) n ans%=P P ans k=map(int,input().split()) map(int,input().split()) k P=10**9+7 10**9+7 P
n,k=map(int,input().split())
P=10**9+7
class FactInv:
    def __init__(self,N,P):
        fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1)
        for i in range(1,N):
            fact[i+1]=(fact[i]*(i+1))%P
        ifact[-1]=pow(fact[-1],P-2,P)
        for i in range(N,0,-1):
            ifact[i-1]=(ifact[i]*i)%P
        self.fact=fact;self.ifact=ifact;self.P=P
    def comb(self,n,k):
        return (self.fact[n]*self.ifact[k]*self.ifact[n-k])%self.P
C=FactInv(2*n+10,P)
ans=0
for i in range(0,min(k+1,n)):
    ans+=(C.comb(n,i)*C.comb(n-1,n-i-1))%P
    ans%=P
print(ans)