#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int n;
  double exv = 0;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<int> s(n + 1, 0);
  for (int i = 0; i < n; i++) s[i + 1] = s[i] + x[i];
  double p = 1.0 / (n - 1);
  for (int i = 1; i < n; i++) {
    exv += (s[i + 1] - s[i]) * p;
  }
  long long f = 1;
  for (int i = 1; i <= n - 1; i++) f *= i;
  long long ans = fmod(fmod(exv, mod) * f, mod);
  cout << ans << endl;
  return 0;
}
