#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long MOD = 1000000007;
  vector<long long> x(N);
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  vector<double> c(N);
  c[0] = 0;
  for (int i = 1; i < N; i++) {
    c[i] = c[i - 1] + 1.0 / i;
  }
  vector<long long> deltax(N);
  deltax[0] = 0;
  for (int i = 1; i < N; i++) {
    deltax[i] = x[i] - x[i - 1];
  }
  double sum = 0;
  for (int i = 1; i < N; i++) {
    sum += c[i] * deltax[i];
  }
  long long mul = 1;
  for (int i = N - 1; i >= 1; i--) {
    mul *= i;
    mul %= MOD;
  }
  long long ans;
  ans = sum * mul;
  ans %= MOD;
  cout << ans << endl;
}
