M=10**9+7;n,k=map(int,input().split());a=c=1
for i in range(1,min(n,k+1)):m=n-i;c=c*-~m*m*pow(i,M-2,M)**2%M;a+=c
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=1 a 1 =c=1 c 1 for i in range(1,min(n,k+1)):m=n-i;c=c*-~m*m*pow(i,M-2,M)**2%M;a+=c 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 k=map(int,input().split()) map(int,input().split()) k n,k=map(int,input().split()) map(int,input().split()) n c=1 1 c a=c=1 1 a M=10**9+7 10**9+7 M
M=10**9+7;n,k=map(int,input().split());a=c=1
for i in range(1,min(n,k+1)):m=n-i;c=c*-~m*m*pow(i,M-2,M)**2%M;a+=c
print(a%M)