#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 200010, mod = 1000000007;
int fac[N], inv[N], ans, sum, n, k, x;
inline int fpow(int x, int p) {
  if (p < 0) return 0;
  int ans = 1;
  for (; p; p >>= 1, x = 1ll * x * x % mod)
    if (p & 1) ans = 1ll * ans * x % mod;
  return ans;
}
inline void initfac(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[n] = fpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
}
inline int pow1(int x) { return (x & 1) ? mod - 1 : 1; }
inline void mian() {
  n = read();
  k = read();
  initfac(k);
  for (int i = 1; i <= n; ++i) x = read(), sum = (sum + x) % mod;
  for (int i = 0; i <= k - 1; ++i)
    ans =
        (ans +
         1ll * pow1(k - 1 - i) * inv[i] % mod * inv[k - 1 - i] % mod *
             ((fpow(i + 1, n - 1) + 1ll * (n - 1) * fpow(i + 1, n - 2) % mod) %
              mod) %
             mod) %
        mod;
  printf("%d\n", 1ll * sum * ans % mod);
}
int main() {
  int qwq = 1;
  while (qwq--) mian();
  return 0;
}
