#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll MOD=(ll)1e9+7LL;
const ll step=(ll)1e9+5LL;
ll n, k;
ll niz[200010];
ll uk;
vector<bool> cif;
void postavi() {
    int b=28;
    for(; b>=0; --b) {
        if((1LL<<b)&step) cif.push_back(1);
        else cif.push_back(0);
    }
}
ll inv(ll y) {
    ll proiz=y;
    for(auto tren:cif) {
        proiz=(proiz*proiz)%MOD;
        if(tren) proiz=(proiz*y)%MOD;
    }
    return proiz;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> n >> k;
    if(k==0) {
        for(int i=0; i<n; ++i) {
            ll x; cin >> x;
            uk+=x;
            if(uk>=MOD) uk%=MOD;
        }
        cout << uk;
        return 0;
    }
    else {
        niz[1]=1LL;
        postavi();
        //cout << inv(2); return 0;
        for(int i=2; i<=n; ++i) {
            niz[i]=((niz[i-1]*(i+k-1LL))%MOD*inv(ll(i)-1LL))%MOD;
            //cout << niz[i] << endl;
        }
        //return 0;
        for(int i=1; i<=n; ++i) {
            ll x; cin >> x;
            uk+=((niz[i]*niz[n-i+1])%MOD*x)%MOD;
        }
        cout << uk;
        return 0;
    }
}