M=10**9+7;n,k=map(int,input().split());a=c=p=1
for i in range(1,min(n,k+1)):c=c*(n-i+1)*(n-i)%M;p=p*i*i%M;a+=c*pow(p,M-2,M)
print(a%M) M=10**9+7 M 10**9+7 10**9 10 9 7 n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k a=c=p=1 a 1 =c=p=1 c 1 p for i in range(1,min(n,k+1)):c=c*(n-i+1)*(n-i)%M;p=p*i*i%M;a+=c*pow(p,M-2,M) i range(1,min(n,k+1)) range 1 min(n,k+1) min n k+1 k 1 print(a%M) print a%M a M n,k=map(int,input().split()) map(int,input().split()) n a=c=p=1 1 a M=10**9+7 10**9+7 M c=p=1 1 c k=map(int,input().split()) map(int,input().split()) k p=1 1 p
M=10**9+7;n,k=map(int,input().split());a=c=p=1
for i in range(1,min(n,k+1)):c=c*(n-i+1)*(n-i)%M;p=p*i*i%M;a+=c*pow(p,M-2,M)
print(a%M)