#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, maxn = 2e5 + 79;
long long pwr(const long long& a, const long long& b) {
  if (!b) return 1;
  long long h = pwr(a, (b >> 1));
  h = (h * h) % mod;
  if (b & 1) h = (h * a) % mod;
  return h;
}
vector<long long> f(maxn, 1), invf(maxn, 1);
long long c(long long n, long long k) {
  return (f[n] * ((invf[k] * invf[n - k]) % mod)) % mod;
}
long long s(long long n, long long k) {
  if (k > n) return 0;
  long long suma = 0;
  for (int j = 1; j <= k; j++) {
    long long cur = (pwr(j, n) * c(k, j)) % mod;
    if ((j + k) & 1) cur = mod - cur;
    suma = (suma + cur) % mod;
  }
  return (suma * invf[k]) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (long long i = 1; i < maxn; i++) {
    f[i] = (f[i - 1] * i) % mod;
    invf[i] = pwr(f[i], mod - 2);
  }
  int n, k;
  cin >> n >> k;
  vector<int> w(n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    sum = (sum + w[i]) % mod;
  }
  long long cnt = (s(n, k) + ((n - 1) * 1ll * s(n - 1, k)) % mod) % mod;
  cout << (sum * cnt) % mod << "\n";
  return 0;
}
