#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  double x[100000];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  double w = 1;
  for (int i = 2; i < n; ++i) {
    w *= i;
  }
  long long ans = ((x[n - 1] - x[0]) * n - 2 + (x[n - 1] - x[1])) / (n - 1) * w;
  cout << ans % 1000000007;
}
