#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k, sum, ans, inv[200005], facinv[200005];
inline int GetInt() {
  int num = 0, k = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') k = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    num = num * 10 + ch - '0';
    ch = getchar();
  }
  return num * k;
}
inline int PlusMod(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline int MinusMod(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }
inline int QuickPower(int x, int k) {
  int s = 1;
  if (k < 0) return 1;
  while (k) {
    if (k & 1) s = 1ll * s * x % mod;
    k >>= 1;
    x = 1ll * x * x % mod;
  }
  return s;
}
int main() {
  n = GetInt(), k = GetInt();
  for (int i = 1; i <= n; i++) sum = PlusMod(sum, GetInt());
  facinv[0] = facinv[1] = inv[1] = 1;
  for (int i = 2; i <= k; i++) {
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
    facinv[i] = 1ll * facinv[i - 1] * inv[i] % mod;
  }
  for (int i = 0; i < k; i++) {
    int tmp = (i & 1 ? -1ll : 1ll) * facinv[i] * facinv[k - 1 - i] % mod;
    ans = (1ll * ans +
           1ll * tmp * QuickPower(k - i, n - 2) % mod * (k - i + n - 1) % mod) %
          mod;
  }
  ans = (ans + mod) % mod;
  ans = 1ll * ans * sum % mod;
  printf("%d", ans);
  return 0;
}
