#include <bits/stdc++.h>
using namespace std;
long long abs(long long a, long long b) { return max(a, b) - min(a, b); }
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, b[1000000], c = 1, d = 0;
  double q;
  cin >> a;
  for (long long i = 0; i < a; i++) {
    cin >> b[i];
  }
  for (long long i = 1; i < a; i++) {
    d = (d + b[i]) % 1000000007;
  }
  for (long long i = 2; i < a; i++) {
    c = (c * i) % 1000000007;
  }
  q = (double)d / (double)(a - 1);
  for (long long i = 2; i < a; i++) {
    q = (q * i);
    if (q == (long long)q) {
      q = (long long)q % 1000000007;
    }
  }
  cout << (long long)q % 1000000007 << "\n";
}
