#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const double PI = 3.1415926535897932;
long long n;
vector<long long> x;
long long solve() {
  cin >> n;
  vector<long long> ruisekiwa(n);
  x.resize(n);
  for (long long i = (0); i < (n); i++) {
    cin >> x[i];
  }
  ruisekiwa[0] = 0;
  for (long long i = 1; i < n; i++) {
    ruisekiwa[i] = x[i] - x[i - 1];
  }
  long double p = 0.0;
  vector<long double> ph;
  ph.push_back(0.0);
  for (long long i = 1; i < n; i++) {
    p += 1 / ((long double)i);
    ph.push_back(p);
  }
  long double ans = 0;
  for (long long i = 1; i < n; i++) {
    ans += ruisekiwa[i] * ph[i];
  }
  long long n_1 = 1;
  for (long long i = 1; i < n; i++) {
    n_1 *= i;
    n_1 %= MOD;
  }
  long long trueans = (long long)(((long long)ans % MOD) * n_1) % MOD;
  cout << trueans << endl;
  return 0;
}
int main() {
  cout << std::fixed << std::setprecision(10);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long end_solve = solve();
  return (int)end_solve;
}
