#include <bits/stdc++.h>

using namespace std;

#define pii pair<int,int>
#define ll long long
#define s second
#define f first

const ll MOD = 1e9 + 7;
const int MAX_N = 2 * 1e5 + 5;
ll n, k, fact[MAX_N], a[MAX_N];


int gcdExtended(ll a, ll b, ll* x, ll* y){
  if (a == 0){
    *x = 0, *y = 1;
    return b;
  }
  ll x1, y1;
  ll gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}

ll modInverse(ll a)
{
  ll x, y;
  ll g = gcdExtended(a, MOD, &x, &y);
  ll res = (x % MOD + MOD) % MOD;
  return res;
}

void precalc(){
  fact[0] = 1;
  for(int i = 1; i < MAX_N; ++i){
    fact[i] = (fact[i - 1] * i) % MOD;
  }
}

ll bin(ll x, ll y){
  return fact[x] * modInverse((fact[y] * fact[x - y]) % MOD) % MOD;
}

ll cnt(ll pos){
  ll a = bin(n + k - 1 - pos, k);
  ll b = bin(pos + k, pos);
  ll res = (a * b) % MOD;
  return res;
}

int main(){
  precalc();
  cin >> n >> k;
  ll res = 0;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
    if(n % 2 == 0){
        if(i >= n /2 ){res = ((res + (cnt(n - i - 1) * a[i]) % MOD) % MOD);}
        else{res = ((res + (cnt(i) * a[i]) % MOD) % MOD);}
    }
    else{
        if(i > n / 2){res = ((res + (cnt(n - i - 1) * a[i]) % MOD) % MOD);}
        else{res = ((res + (cnt(i) * a[i]) % MOD) % MOD);}
    }
  }
  cout << res << endl;
  return 0;
}