#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5+45;
const int mod = 1000000007;

ll n,k,a[N];
ll f[N],invf[N];

ll fp(ll x,ll y){
    if(!y) return 1;
    ll p = fp(x,y/2);
    p = (p*p)%mod;
    if(y&1) p = (p*x)%mod;
    return p;
}

ll c(ll a,ll b){
    if(a < b) return 0;
    return (((f[a]*invf[a-b])%mod)*invf[b])%mod;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    f[0] = invf[0] = 1;
    for(int i = 1; i < N; i++){
        f[i] = (f[i-1]*i)%mod;
        invf[i] = fp(f[i],mod-2);
    }

    cin >> n >> k;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }

    ll sol = 0;
    for(ll i = 1; i <= n; i++){
        ll sta = c(k+i-1,k);
        sta *= c(k+n-i,k);
        sta %= mod;
        if(sta < 0) sta += mod;
        sta *= a[i];
        sta %= mod;
        if(sta < 0) sta += mod;

        sol += sta;
        sol %= mod;
        if(sol < 0) sol += mod;
    }

    cout << sol << endl;
}