#include <bits/stdc++.h>
using namespace std;
const int N = 200001;
const long long mod = 1000000007ll;
int n, k;
long long fact[N], inv[N], inv_fact[N];
long long w[N], s = 0;
long long C(int a, int b) {
  if (a < b)
    return 0;
  else
    return (fact[a] * ((inv_fact[b] * inv_fact[a - b]) % mod)) % mod;
}
long long qpow(long long a, int m) {
  long long ret = 1;
  while (m) {
    if (m & 1) ret = (ret * a) % mod;
    a = (a * a) % mod, m >>= 1;
  }
  return ret;
}
long long S(int a, int b) {
  long long total = 0;
  if (a < b) return 0;
  for (int i = 0; i <= b; i++) {
    long long delta = 0;
    delta = C(b, i);
    if ((b - i) & 1) delta = (mod - delta) % mod;
    total = (total + delta * qpow(1ll * i, a)) % mod;
  }
  return (total * inv_fact[b]) % mod;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &w[i]), s = (s + w[i]) % mod;
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = ((mod / i) * (mod - inv[mod % i])) % mod;
  fact[0] = 1, inv_fact[0] = 1;
  for (int i = 1; i <= n; i++)
    fact[i] = (fact[i - 1] * 1ll * i) % mod,
    inv_fact[i] = (inv_fact[i - 1] * inv[i]) % mod;
  long long num = (S(n, k) + 1ll * (n - 1) * S(n - 1, k)) % mod;
  printf("%lld\n", (num * s) % mod);
  return 0;
}
