#include <bits/stdc++.h>

using namespace std;

#define int ll
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;

int k;
const int maxn = 2e5 + 10, mod = 1e9+7;
vi fact(maxn), inv(maxn);

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

    if (x >= mod)
        x %= mod;
}

int g(int x){
    f(x);
    return x;
}

ll st(ll a, ll k){
    f(a);
    if (k == 0)
        return 1;

    if (k == 1)
        return a;

    ll tmp = st(a, k / 2);
    tmp = g(tmp * tmp);
    
    if (k & 1)
        tmp = tmp * a;
    return g(tmp);
}    


int c(int x){
    if (x < k)
        return 0;
    int s = fact[x] * inv[k];
    f(s);
    s *= inv[x-k];
    return g(s);
}

int calc(int n, int a){
    int sol = c(n+k-1) * c(a+k-1);
    return g(sol);
}

signed main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr); 
    cerr.tie(nullptr);    

    int n;
    cin >> n >> k;

    fact[0] = 1;
    inv[0] = 1;
    for (int i = 1; i <= max(n, k); ++i){
        fact[i] = g(i*fact[i-1]);
        inv[i] = st(fact[i], mod-2);
    }

    vi a(n);
    for (auto& i : a)
        cin >> i;

    int b= 1, sol = 0;
    while(n >= 1){
        sol += g(a[b-1] * calc(n, b));
        f(sol);
        --n;
        ++b;
    }

    cout << sol << '\n';
}