#include <bits/stdc++.h>
using namespace std;
void qmax(int &x, int y) {
  if (x < y) x = y;
}
void qmin(int &x, int y) {
  if (x > y) x = y;
}
inline int read() {
  char s;
  int k = 0, base = 1;
  while ((s = getchar()) != '-' && s != EOF && !(isdigit(s)))
    ;
  if (s == EOF) exit(0);
  if (s == '-') base = -1, s = getchar();
  while (isdigit(s)) {
    k = k * 10 + (s ^ '0');
    s = getchar();
  }
  return k * base;
}
inline void write(int x) {
  static char cnt, num[15];
  cnt = 0;
  if (!x) {
    printf("0");
    return;
  }
  for (; x; x /= 10) num[++cnt] = x % 10;
  for (; cnt; putchar(num[cnt--] + 48))
    ;
}
const long long mod = 1e9 + 7;
long long ksm(long long x, int y) {
  long long sum = 1;
  while (y) {
    if (y & 1) sum = sum * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return sum;
}
const int maxn = 2e5 + 100;
long long n, k, ans, S, jie[maxn], ny[maxn], X, S1;
int main() {
  n = read();
  k = read();
  jie[0] = 1;
  for (int i = 1; i <= k; i++) jie[i] = jie[i - 1] * i % mod;
  ny[k] = ksm(jie[k], mod - 2);
  for (int i = k - 1; i >= 0; i--) ny[i] = ny[i + 1] * (i + 1) % mod;
  for (int i = 1; i <= k; i++) {
    if ((k - i) % 2 == 1) {
      S = S - jie[k] * ny[i] % mod * ny[k - i] % mod * ksm(i, n) % mod;
      if (S < 0) S += mod;
    } else {
      S = S + jie[k] * ny[i] % mod * ny[k - i] % mod * ksm(i, n) % mod;
      if (S >= mod) S -= mod;
    }
  }
  S = S * ny[k] % mod;
  S1 = S;
  S = 0;
  n--;
  for (int i = 1; i <= k; i++) {
    if ((k - i) % 2 == 1) {
      S = S - jie[k] * ny[i] % mod * ny[k - i] % mod * ksm(i, n) % mod;
      if (S < 0) S += mod;
    } else {
      S = S + jie[k] * ny[i] % mod * ny[k - i] % mod * ksm(i, n) % mod;
      if (S >= mod) S -= mod;
    }
  }
  S = S * ny[k] % mod;
  S = n * S % mod + S1;
  S %= mod;
  n++;
  for (int i = 1; i <= n; i++) {
    X = read();
    ans = ans + S * X % mod;
    if (ans >= mod) ans -= mod;
  }
  printf("%lld\n", ans);
  return 0;
}
