#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
inline int Qpow(int a, int b) {
  int ans = 1;
  for (; b; a = 1LL * a * a % MOD, b >>= 1)
    if (b & 1) ans = 1LL * ans * a % MOD;
  return ans;
}
inline int inv(int x) { return Qpow(x, MOD - 2); }
int n, K;
inline int S(int n, int m) {
  if (n < m) return 0;
  int ans = 0, fac = 1;
  for (int i = 1; i <= m; ++i) fac = 1LL * fac * i % MOD;
  for (int i = 0, pro = 1; i <= m; ++i) {
    ans = (ans + 1LL * Qpow(MOD - 1, m - i) * inv(pro) % MOD * Qpow(i, n) %
                     MOD * inv(fac)) %
          MOD;
    fac = 1LL * fac * inv(m - i) % MOD, pro = 1LL * pro * (i + 1) % MOD;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &K);
  int sum = 0;
  for (int i = 1, x; i <= n; ++i) scanf("%d", &x), sum = (sum + x) % MOD;
  int ans = 1LL * sum * (S(n, K) + 1LL * (n - 1) * S(n - 1, K) % MOD) % MOD;
  printf("%d\n", ans);
  return 0;
}
