#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, K, sum;
int inv[200005];
int KSM(int x, int k) {
  int s = 1;
  for (; k; k >>= 1, x = 1LL * x * x % mod)
    if (k & 1) s = 1LL * s * x % mod;
  return s;
}
int S(int n, int K) {
  if (K > n) return 0;
  int Ans = 0;
  for (int i = 0; i <= K; i++)
    if (i & 1)
      Ans =
          (Ans - 1LL * inv[i] * inv[K - i] % mod * KSM(K - i, n) % mod + mod) %
          mod;
    else
      Ans = (Ans + 1LL * inv[i] * inv[K - i] % mod * KSM(K - i, n) % mod) % mod;
  return Ans;
}
int main() {
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; i++) {
    int A;
    scanf("%d", &A);
    sum = (sum + A) % mod;
  }
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = mod - 1LL * (mod / i) * inv[mod % i] % mod;
  for (int i = 2; i <= n; i++) inv[i] = 1LL * inv[i - 1] * inv[i] % mod;
  printf("%d\n",
         1LL * sum * (1LL * (n - 1) * S(n - 1, K) % mod + S(n, K)) % mod);
  return 0;
}
