#include <bits/stdc++.h>
#pragma GCC optimize(2)
const int maxn = 2e5 + 5, mod = 1e9 + 7;
template <typename T>
inline T max(const T &a, const T &b) {
  return a > b ? a : b;
}
int fastpow(int x, int y) {
  if (y == 0) return 1;
  int tmp = fastpow(x, y >> 1);
  return y & 1 ? 1ll * tmp * tmp % mod * x % mod : 1ll * tmp * tmp % mod;
}
inline int reset(int &x) { return x = x < 0 ? x + mod : x; }
int n, w[maxn], k, lim, fact[maxn], inv_fact[maxn];
int answer, base;
inline int binom(int x, int y) {
  if (x < y || y < 0) return 0;
  return 1ll * fact[x] * inv_fact[y] % mod * inv_fact[x - y] % mod;
}
inline int S(int n, int k) {
  if (n < k) return 0;
  int answer = 0;
  for (int i = 0; i <= k; i++)
    answer += ((k - i) & 1 ? -1ll : 1ll) * binom(k, i) * fastpow(i, n) % mod,
        answer %= mod;
  return reset(answer = 1ll * answer * inv_fact[k] % mod);
}
int main() {
  scanf("%d%d", &n, &k);
  lim = max(n, k);
  fact[0] = 1;
  for (int i = 1; i <= lim; i++) fact[i] = 1ll * i * fact[i - 1] % mod;
  inv_fact[lim] = fastpow(fact[lim], mod - 2);
  for (int i = lim - 1; i >= 0; i--)
    inv_fact[i] = 1ll * inv_fact[i + 1] * (i + 1) % mod;
  base = (S(n, k) + 1ll * (n - 1) * S(n - 1, k)) % mod;
  for (int i = 1; i <= n; i++) scanf("%d", &w[i]);
  for (int i = 1; i <= n; i++) (answer += 1ll * w[i] * base % mod) %= mod;
  printf("%d\n", answer);
  return 0;
}
