mod=10**9+7
comb1=1
comb2=1
N,K=map(int,input().split())
k=min(K,N-1)
x=0
for i in range(k):
 comb1=(comb1*(N-i)*pow(i+1,mod-2,mod))%(mod)
 comb2=(comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod)
 x+=(comb1*comb2)%(mod)
print((x+1)%(mod)) mod=10**9+7 mod 10**9+7 10**9 10 9 7 comb1=1 comb1 1 comb2=1 comb2 1 N,K=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K k=min(K,N-1) k min(K,N-1) min K N-1 N 1 x=0 x 0 for i in range(k):
 comb1=(comb1*(N-i)*pow(i+1,mod-2,mod))%(mod)
 comb2=(comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod)
 x+=(comb1*comb2)%(mod) i range(k) range k comb1=(comb1*(N-i)*pow(i+1,mod-2,mod))%(mod) comb1 (comb1*(N-i)*pow(i+1,mod-2,mod))%(mod) comb1*(N-i)*pow(i+1,mod-2,mod) comb1*(N-i) comb1 N-i N i pow(i+1,mod-2,mod) pow i+1 i 1 mod-2 mod 2 mod mod comb2=(comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod) comb2 (comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod) comb2*(N-1-i)*pow(i+1,mod-2,mod) comb2*(N-1-i) comb2 N-1-i N-1 N 1 i pow(i+1,mod-2,mod) pow i+1 i 1 mod-2 mod 2 mod mod x+=(comb1*comb2)%(mod) x (comb1*comb2)%(mod) comb1*comb2 comb1 comb2 mod print((x+1)%(mod)) print (x+1)%(mod) x+1 x 1 mod K=map(int,input().split()) map(int,input().split()) K comb2=(comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod) (comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod) comb2 comb1=1 1 comb1 comb2=1 1 comb2 x=0 0 x k=min(K,N-1) min(K,N-1) k comb1=(comb1*(N-i)*pow(i+1,mod-2,mod))%(mod) (comb1*(N-i)*pow(i+1,mod-2,mod))%(mod) comb1 x+=(comb1*comb2)%(mod) (comb1*comb2)%(mod) x mod=10**9+7 10**9+7 mod N,K=map(int,input().split()) map(int,input().split()) N
mod=10**9+7
comb1=1
comb2=1
N,K=map(int,input().split())
k=min(K,N-1)
x=0
for i in range(k):
 comb1=(comb1*(N-i)*pow(i+1,mod-2,mod))%(mod)
 comb2=(comb2*(N-1-i)*pow(i+1,mod-2,mod))%(mod)
 x+=(comb1*comb2)%(mod)
print((x+1)%(mod))
