#include <bits/stdc++.h>
#define NUM 1000000007
using namespace std;

long long factorial(int a, int b) {
	if(a<=b) return b;
	return a*factorial(a-1, b);
}
int sum(int n, int x) {
	if(n<0) return 1;
	int a=factorial(x+n, x)/factorial(n+1, 1);
	if(a>NUM) a%=NUM;
	return a;
}
int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	int N, k;
	long long rez=0, m;
	cin>>N>>k;
	k--;
	int A[N];
	for(int i=0; i<N; i++) cin>>A[i];
	for(int i=0; i<N; i++) {
		m=sum(k, i+1)*sum(k, N-i);
		if(m>NUM) m%=NUM;
		rez+=m*A[i];
		if(rez>NUM) rez%=NUM;
	}
	cout<<rez;
	return 0;
}
/*
sum0(x)=x/1
sum1(x)=x*(x+1)/(1*2)
sum2(x)=x*(x+1)*(x+2)/(1*2*3)
sum3(x)=x*(x+1)*(x+2)*(x+3)/(1*2*3*4)
*/