#include <bits/stdc++.h>
#define maxn 400020
#define int long long
using namespace std;

int n,k, a[maxn];
long long ans, fV[maxn], inV[maxn];
const int mod = 1e9 + 7;

int f(int i, int j, int l){
	int res = 0;
	if(l == 0){
		for(int i1=i;i1<=j;++i1){
			res += a[i1];
			res%=mod;
		}
	} else {
		for(int i1=i;i1<=j;++i1){
			for(int j1 = i1; j1 <= j; ++j1){
				res += f(i1, j1, l-1);
				res %= mod;
			}
		}
	}
	return res;
}

void fix(int &x){
	x %= mod;
	if(x < 0){
		x += mod;
	}
}

int binPow(int a, int b){
	int res = 1;
	while(b){
		if(b & 1){
			res = res*a;
			fix(res);
		}
		a *= a;
		fix(a);
		b/=2;
	}
	return res;
}

void getF(){
	fV[0] =1 ;
	for(int i = 1; i < maxn; ++i){
		fV[i] = fV[i-1]*i;
		fix(fV[i]);
	}
	inV[maxn-1] = binPow(fV[maxn-1], mod-2);
	for(int i = maxn-2; i >= 0; --i){
		inV[i] = (i+1)*inV[i+1];
		fix(inV[i]);
	}
}

signed main(){
	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	cin >> n >> k;
	for(int i = 0; i < n; ++i){
		cin >> a[i];
	}
	getF();
	//cerr << (inV[200000]*fV[200000])%mod << '\n';
	for(int i = 0; i < n; ++i){
		int tmp = fV[n-i-1+k]*fV[i+k];
		fix(tmp);
		tmp*=inV[k];
		fix(tmp);
		tmp*=inV[k];

		fix(tmp);
		tmp*=inV[i];
		fix(tmp);
		tmp*=inV[n-i-1];
		fix(tmp);
		tmp *= a[i];
		fix(tmp);
		ans += tmp;
		fix(ans);
	}
	// nCr[0][0] = 1;
	// for(int i = 1; i <= n+k; ++i){
	// 	nCr[i][0] = 1;
	// 	for(int j = 1; j <= min(i, k); ++j){
	// 		nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1];
	// 	}
	// }
	// for(int i = 0; i < n; ++i){
	// 	long long tmp = nCr[i+k][k]*nCr[n-i+k-1][k];
	// 	tmp %= mod;
	// 	ans += tmp*a[i];
	// 	ans %= mod;
	// }
	cout << ans;
}