#include <bits/stdc++.h>
using namespace std;
int gi() {
  int x = 0, w = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') w = 0, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return w ? x : -x;
}
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int n, k, sum, inv[N], jc[N], jcn[N], ans;
int fastpow(int a, int b) {
  if (b < 0) return 1;
  int res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  n = gi();
  k = gi();
  for (int i = 1; i <= n; ++i) sum = (sum + gi()) % mod;
  inv[0] = inv[1] = jc[0] = jcn[0] = 1;
  for (int i = 2; i <= n; ++i)
    inv[i] = 1ll * inv[mod % i] * (mod - mod / i) % mod;
  for (int i = 1; i <= n; ++i)
    jc[i] = 1ll * jc[i - 1] * i % mod, jcn[i] = 1ll * jcn[i - 1] * inv[i] % mod;
  for (int j = 0; j < k; ++j) {
    int x = 1ll * (j & 1 ? mod - 1 : 1) * jcn[j] % mod * jcn[k - 1 - j] % mod;
    ans = (ans + 1ll * x * fastpow(k - j, n - 2) % mod * (k - j + n - 1)) % mod;
  }
  ans = 1ll * ans * sum % mod;
  printf("%d\n", ans);
  return 0;
}
