#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll  mod=1e9+7;
const ll  mn=2*1e5+100;
const ll mnn=4*mn;
ll  a[mn];
ll fact[mnn];
ll stepen(ll x,ll y)
{
    x%=mod;
    ll r=1;
    while(y>0)
    {
        if(y&1)
        {
            r=((r%mod)*(x%mod))%mod;
        }
        x=(x*x)%mod;
        y>>=1;
    }
    return r;
}
ll inv(ll x)
{
    return stepen(x,mod-2);
}
ll mul(ll x,ll y)
{
    //cout<<y<<endl;
    ll rez=(x%mod)*(y%mod);
    //cout<<(x%mod)<<" "<<(y%mod)<<endl;
    //cout<<rez<<endl;
    rez%=mod;
    return rez;
}
ll add(ll a,ll b)
{
    ll rez=((a%mod)+(b%mod))%mod;
    return rez;
}
void init(ll x)
{
    fact[0]=1;
    for(ll  i=1;i<=x;i++)
    {
        fact[i]=((fact[i-1]%mod)*(i%mod))%mod;
    }
}
//promena
ll C(ll n,ll k)
{
    ll rez=mul(fact[n],mul(inv(fact[k]),inv(fact[n-k])));
    return rez;
}
ll brk(ll n,ll k)
{
    return C(n+k-1,k);
}
//promeni
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll  n,k;
    cin>>n>>k;
    for(ll  i=0;i<n;i++) cin>>a[i];
    ll kolko=0;
    init(mnn-1);
    for(ll  i=0;i<n;i++)
    {
        //cout<<"DEBUG"<<endl;
        ll pojav=mul(brk(i+1,k),brk(n-i,k));
        kolko=add(mul(pojav,a[i]),kolko);
        //cout<<kolko<<endl;
    }
    //cout<<kolko<<endl;
    cout<<kolko<<endl;
    return 0;
}