#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAX = 100010;
long long fac[MAX], finv[MAX], inv[MAX];
void cmbInit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
    inv[i] = MOD - (inv[MOD % i] * (MOD / i)) % MOD;
    finv[i] = (finv[i - 1] * inv[i]) % MOD;
  }
}
int main() {
  int n;
  cin >> n;
  vector<long long> x(n - 1);
  long long xin, oxin;
  for (int i = 0; i < n; i++) {
    cin >> xin;
    if (i > 0) x[i] = xin - oxin;
    oxin = xin;
  }
  vector<long long> p(n), sump(n);
  cmbInit();
  for (int i = 1; i < n; i++) {
    p[i] = (fac[n - 1] * finv[i]) % MOD;
    if (i == 1)
      sump[i] = p[i];
    else
      sump[i] = (p[i] + sump[i - 1]) % MOD;
  }
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    ans += (x[i] * sump[i]) % MOD;
    ans = ans % MOD;
  }
  cout << ans << endl;
}
