#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define xx first
#define yy second
#define srt(a) sort(a.begin(),a.end());
#define srtg(a,int) sort(a.begin(),a.end(),greater<int>())
#define lb(a,x) lower_bound(a.begin(),a.end(),x)
#define up(a,x) upper_bound(a.begin(),a.end(),x)
#define fnd(a,x) find(a.begin(),a.end(),x)
#define vstart auto startt=chrono::system_clock::now()
#define vend auto endd=chrono::system_clock::now()
#define vvreme chrono::duration<double> vremee=endd-startt
#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef string str;

const ll mod=1e9+7;
const ll maxn=4e5+2;

ll fakt[maxn];
ll inv[maxn];
ll finv[maxn];

ll mul(ll a,ll b){
    if(a*b>=mod) return a*b%mod;
    return a*b;
}

ll pwr(ll a,ll b){
    ll ret=1;
    while(b>0){
        if(b&1) ret=mul(ret,a);
        b=(b>>1);
        a=mul(a,a);
    }
    return ret;
}

ll nck(ll n,ll k){
    ll ret=fakt[n];
//    cout<<"gas:\n";
//    cout<<n<<" "<<fakt[n]<<"\n";
//    cout<<n-k<<" "<<finv[n-k]<<"\n";
//    cout<<k<<" "<<finv[k]<<"\n";
    ret=mul(ret,finv[n-k]);
    ret=mul(ret,finv[k]);
    return ret;
}

ll biraj(ll n,ll m){
    return nck(n+m-1,m);
}

void solve(){
    ll n,k;
    cin>>n>>k;
    inv[1]=1;
    fakt[0]=1;
    fakt[1]=1;
    finv[0]=1;
    finv[1]=1;
    for(int i=2;i<maxn;i++){
        fakt[i]=mul(fakt[i-1],i);
        inv[i]=mod-mod/i*inv[mod%i]%mod;
        //cout<<i<<" "<<inv[i]<<"\n";
        if(inv[i]>=mod) inv[i]%=mod;
        finv[i]=mul(finv[i-1],inv[i]);
    }
    ll res=0;
    for(int i=0;i<n;i++){
        ll a;
        cin>>a;
        //cout<<i+1<<" "<<k<<" "<<biraj(i+1,k)<<"\n";
        res+=a*mul(biraj(i+1,k),biraj(n-i,k));
        if(res>=mod) res%=mod;
    }
    cout<<res<<" ";
}

int main(){
    ios;
    int t=1;
    //cin>>t;
    while(t--) solve();
    return 0;
}