#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  double mod = 1000000007;
  cin >> n;
  double* x;
  x = new double[n];
  int i;
  double add = 0;
  double c = n - 1;
  for (i = 0; i < n; i++) {
    double a;
    cin >> a;
    a = fmod(a, mod);
    x[i] = a;
    add += a;
  }
  int f = n - 1;
  double j;
  for (int i = 0;; i++) {
    add -= x[f];
    ++f;
    if (i == n - 1) {
      j = add / c;
      break;
    } else {
      j = add / c;
      --c;
    }
  }
  cout << j;
  double sum = 1;
  for (int i = 1; i <= n - 1; ++i) {
    sum *= i;
  }
  double kotae = fmod(j * sum, mod);
  cout << kotae;
  delete[] x;
}
