#include <bits/stdc++.h>
using namespace std;
double MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<double> Slime(N);
  for (int i = 0; i < N; ++i) {
    cin >> Slime.at(i);
  }
  double proba = (double)1 / (double)(N - 1);
  double sum = 0;
  double result = 0;
  double dist = 0;
  int i = 0;
  while (i != N - 1) {
    dist += Slime.at(N - 1) - Slime.at(i);
    sum += proba * dist;
    ++i;
  }
  double Fact = N - 1;
  for (int F = N - 2; F > 0; --F) {
    Fact *= (double)F;
  }
  result = fmod(sum * Fact, MOD);
  cout << result << endl;
  return 0;
}
