"""
E
"""
mod=10**9+7
MAX=4*10**5+100

g1=[1,1]
for i in range(2,MAX+1):
    num_1=g1[-1]*i%mod
    g1.append(num_1)
    
def cmb(n,r):
    return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod


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

ans=cmb(2*N-1,N)


if K>=N:
    print(ans)
    
else:
    num=cmb(N,N-K-1)
    S=0
    for i in range(N-K-1,0,-1):
        S=(S+cmb(N-1,i-1)*cmb(N,i))%mod
        
    ans=(ans-S)%mod
    print(ans) """
E
""" mod=10**9+7 mod 10**9+7 10**9 10 9 7 MAX=4*10**5+100 MAX 4*10**5+100 4*10**5 4 10**5 10 5 100 g1=[1,1] g1 [1,1] 1 1 for i in range(2,MAX+1):
    num_1=g1[-1]*i%mod
    g1.append(num_1)
     i range(2,MAX+1) range 2 MAX+1 MAX 1 num_1=g1[-1]*i%mod num_1 g1[-1]*i%mod g1[-1]*i g1[-1] g1 -1 i mod g1.append(num_1) g1.append g1 append num_1 def cmb(n,r):
    return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod cmb return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod) g1[n]*pow(g1[r],mod-2,mod) g1[n] g1 n pow(g1[r],mod-2,mod) pow g1[r] g1 r mod-2 mod 2 mod pow(g1[n-r],mod-2,mod) pow g1[n-r] g1 n-r n r mod-2 mod 2 mod mod n n r r N,K=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K ans=cmb(2*N-1,N) ans cmb(2*N-1,N) cmb 2*N-1 2*N 2 N 1 N if K>=N:
    print(ans)
    
else:
    num=cmb(N,N-K-1)
    S=0
    for i in range(N-K-1,0,-1):
        S=(S+cmb(N-1,i-1)*cmb(N,i))%mod
        
    ans=(ans-S)%mod
    print(ans) K>=N K N print(ans) print ans num=cmb(N,N-K-1) num cmb(N,N-K-1) cmb N N-K-1 N-K N K 1 S=0 S 0 for i in range(N-K-1,0,-1):
        S=(S+cmb(N-1,i-1)*cmb(N,i))%mod
        
     i range(N-K-1,0,-1) range N-K-1 N-K N K 1 0 -1 S=(S+cmb(N-1,i-1)*cmb(N,i))%mod S (S+cmb(N-1,i-1)*cmb(N,i))%mod S+cmb(N-1,i-1)*cmb(N,i) S cmb(N-1,i-1)*cmb(N,i) cmb(N-1,i-1) cmb N-1 N 1 i-1 i 1 cmb(N,i) cmb N i mod ans=(ans-S)%mod ans (ans-S)%mod ans-S ans S mod print(ans) print ans K=map(int,input().split()) map(int,input().split()) K N,K=map(int,input().split()) map(int,input().split()) N S=(S+cmb(N-1,i-1)*cmb(N,i))%mod (S+cmb(N-1,i-1)*cmb(N,i))%mod S mod=10**9+7 10**9+7 mod num_1=g1[-1]*i%mod g1[-1]*i%mod num_1 num=cmb(N,N-K-1) cmb(N,N-K-1) num S=0 0 S def cmb(n,r):
    return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod def cmb(n,r):
    return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod cmb g1=[1,1] [1,1] g1 MAX=4*10**5+100 4*10**5+100 MAX ans=cmb(2*N-1,N) cmb(2*N-1,N) ans ans=(ans-S)%mod (ans-S)%mod ans
"""
E
"""
mod=10**9+7
MAX=4*10**5+100

g1=[1,1]
for i in range(2,MAX+1):
    num_1=g1[-1]*i%mod
    g1.append(num_1)
    
def cmb(n,r):
    return g1[n]*pow(g1[r],mod-2,mod)*pow(g1[n-r],mod-2,mod)%mod


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

ans=cmb(2*N-1,N)


if K>=N:
    print(ans)
    
else:
    num=cmb(N,N-K-1)
    S=0
    for i in range(N-K-1,0,-1):
        S=(S+cmb(N-1,i-1)*cmb(N,i))%mod
        
    ans=(ans-S)%mod
    print(ans)