#include <bits/stdc++.h>
using namespace std;
const int _ = 2e5 + 5, yl = 1e9 + 7;
long long n, k, sum, mul[_], inv[_];
void inc(long long &x, long long y) {
  x += y;
  if (x >= yl) x -= yl;
}
void dec(long long &x, long long y) {
  x -= y;
  if (x < 0) x += yl;
}
long long POW(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % yl;
    x = x * x % yl;
    y >>= 1;
  }
  return res;
}
long long S(int x, int y) {
  long long res = 0;
  for (int i = 0; i <= y; ++i)
    if (i & 1)
      dec(res, POW(y - i, x) * inv[i] % yl * inv[y - i] % yl);
    else
      inc(res, POW(y - i, x) * inv[i] % yl * inv[y - i] % yl);
  return res;
}
int main() {
  cin >> n >> k;
  inv[0] = inv[1] = mul[0] = 1;
  for (int i = 2; i <= n; ++i) inv[i] = (yl - yl / i) * inv[yl % i] % yl;
  for (int i = 1; i <= n; ++i)
    mul[i] = mul[i - 1] * i % yl, inv[i] = inv[i] * inv[i - 1] % yl;
  for (int i = 1, x; i <= n; ++i) cin >> x, sum += x;
  cout << sum % yl * (S(n, k) + (n - 1) * S(n - 1, k) % yl) % yl << endl;
}
