#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
const int N = 2e5 + 5, MOD = 1e9 + 7;
template <long long MOD>
class Num {
 private:
  long long expow(long long base, long long e) {
    long long ans = 1;
    for (; e > 0; e /= 2) {
      if (e % 2) ans = ans * base % MOD;
      base = base * base % MOD;
    }
    return ans;
  }

 public:
  long long val;
  Num(long long _val) {
    val = _val % MOD;
    val = val < 0 ? val + MOD : val;
  }
  Num() : val(0) {}
  inline Num operator+(const Num &arg) {
    Num res;
    res.val = val + arg.val;
    res.val = res.val >= MOD ? res.val - MOD : res.val;
    return res;
  }
  inline Num operator-(const Num &arg) {
    Num res;
    res.val = val - val;
    res.val = res.val < 0 ? res.val + MOD : res.val;
    return res;
  }
  inline Num operator-() {
    Num res;
    res.val = MOD - res.val;
    res.val = res.val == MOD ? 0 : res.val;
    return res;
  }
  inline Num operator^(const int &arg) { return Num(expow(val, arg)); }
  inline Num operator*(const Num &arg) { return Num(val * arg.val); }
  inline Num operator/(const Num &arg) {
    return Num(val * expow(arg.val, MOD - 2));
  }
  inline void operator+=(const Num &arg) { (*this) = (*this) + arg; }
  inline void operator-=(const Num &arg) { (*this) = (*this) - arg; }
  inline void operator*=(const Num &arg) { (*this) = (*this) * arg; }
  inline void operator/=(const Num &arg) { (*this) = (*this) / arg; }
  inline void operator^=(const long long &arg) { val = expow(val, arg); }
};
template <long long MOD>
ostream &operator<<(ostream &fo, const Num<MOD> &c) {
  fo << c.val;
  return fo;
}
template <long long MOD>
istream &operator>>(istream &fi, Num<MOD> &c) {
  fi >> c.val;
  c = Num<MOD>(c.val);
  return fi;
}
Num<MOD> fact[N], inv[N];
Num<MOD> sum;
int n, k;
static Num<MOD> stirling(int n, int k) {
  Num<MOD> ant;
  for (int i = 1; i <= k; ++i)
    ant += (fact[k] / fact[i] / fact[k - i]) * ((k - i) % 2 ? -1 : 1) *
           (Num<MOD>(i) ^ n);
  return ant / fact[k];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int t, i = 0; i < n; ++i) {
    cin >> t;
    sum += t;
  }
  fact[0] = 1;
  for (int i = 1; i < N; ++i) fact[i] = fact[i - 1] * i;
  inv[N - 1] = Num<MOD>(1) / fact[N - 1];
  for (int i = N - 2; i >= 1; --i) inv[i] = inv[i + 1] * (i + 1);
  cout << sum * (stirling(n, k) + stirling(n - 1, k) * (n - 1)) << endl;
  return 0;
}
