#include <bits/stdc++.h>
using namespace std;
const int p = 1e9 + 7;
const int maxn = 2e5 + 5;
int fac[maxn], inv[maxn];
int ksm(int a, int b, int p) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % p;
    b >>= 1, a = 1ll * a * a % p;
  }
  return ans;
}
int s(int n, int k) {
  int ans = 0;
  for (int i = 0; i <= k; ++i)
    ans = 1ll *
          (ans + 1ll * ((i & 1) ? (p - 1) : 1) * inv[i] % p * ksm(k - i, n, p) %
                     p * inv[k - i] % p) %
          p;
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, k, x;
  cin >> n >> k;
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    sum += x;
    sum %= p;
  }
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % p;
  inv[n] = ksm(fac[n], p - 2, p);
  for (int i = n - 1; i >= 1; --i) inv[i] = 1ll * inv[i + 1] * (i + 1) % p;
  cout << 1ll * sum * (s(n, k) + 1ll * (n - 1) * s(n - 1, k) % p) % p << '\n';
  return 0;
}
