n,k,*a=map(int,open(0).read().split());m=10**9+7;d=1 for i in range(1,n):d=d*(k+i)*pow(i,m-2,m)%m;a[i]*=d;a[-i-1]*=d print(sum(a)%m)