#include <bits/stdc++.h>
using namespace std;
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
long long mod = 1e9 + 7;
signed main() {
  int n;
  cin >> n;
  long long x[100004];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long sa[100004];
  long long ruiseki = 0;
  for (int i = 0; i < n - 1; i++) {
    sa[i] = x[i + 1] - x[i];
    ruiseki += sa[i];
    ruiseki %= mod;
  }
  long long ans = 0;
  long long ruijou[100004];
  ruijou[0] = 1;
  for (int i = 1; i <= 100003; i++) {
    ruijou[i] = ruijou[i - 1] * i;
  }
  ans += (ruiseki * ruijou[n - 1]) % mod;
  long long now = ruijou[n - 1];
  for (int i = 0; i < n - 2; i++) {
    ruiseki -= sa[i];
    ruiseki += mod;
    ruiseki %= mod;
    now -=
        ((ruijou[i] * modinv(ruijou[i + 2], mod) % mod) * ruijou[n - 1]) % mod;
    now += mod;
    now %= mod;
    ans += (now * ruiseki) % mod;
    ans %= mod;
  }
  cout << ans;
}
