#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long readll() {
  long long f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int MAXN = 2e5 + 5, MOD = 1e9 + 7;
inline int pow_mod(int x, int i) {
  int y = 1;
  while (i) {
    if (i & 1) y = (long long)y * x % MOD;
    x = (long long)x * x % MOD;
    i >>= 1;
  }
  return y;
}
int n, K, w[MAXN], fac[MAXN];
int main() {
  n = read();
  K = read();
  for (int i = 1; i <= n; ++i) w[i] = read();
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = (long long)fac[i - 1] * i % MOD;
  int s1 = 0, s2 = 0;
  for (int i = 0; i <= K; ++i)
    s1 = (s1 + (long long)pow_mod(i, n) * pow_mod(MOD - 1, K - i) % MOD *
                   pow_mod(fac[i], MOD - 2) % MOD *
                   pow_mod(fac[K - i], MOD - 2) % MOD) %
         MOD;
  for (int i = 0; i <= K; ++i)
    s2 = (s2 + (long long)pow_mod(i, n - 1) * pow_mod(MOD - 1, K - i) % MOD *
                   pow_mod(fac[i], MOD - 2) % MOD *
                   pow_mod(fac[K - i], MOD - 2) % MOD) %
         MOD;
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    ans = (ans + (long long)w[i] *
                     ((s1 + (long long)(n - 1) * s2 % MOD) % MOD) % MOD) %
          MOD;
  cout << ans << endl;
  return 0;
}
