#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  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() {
  COMinit();
  int N;
  cin >> N;
  vector<long long> x(N, 0);
  vector<long long> l(N - 1, 0);
  vector<long long> imos_l(N - 1, 0);
  vector<long long> S(N - 1, 0);
  for (int i = 0; i < (int)(N); i++) {
    cin >> x[i];
  }
  for (int i = 0; i < (int)(N - 1); i++) {
    l[i] = x[i + 1] - x[i];
    imos_l[i] = x[i + 1] - x[0];
    imos_l[i] %= MOD;
  }
  long long sum = 0;
  for (int i = 0; i < (int)(N - 1); i++) {
    sum += imos_l[i];
    sum %= MOD;
  }
  S[0] = l[N - 2];
  for (int i = 0; i < (int)(N - 2); i++) {
    S[i + 1] = S[i] + ((i + 2) * l[N - 1 - (i + 1)]) % MOD;
    S[i + 1] %= MOD;
  }
  reverse(S.begin(), S.end());
  long long num = 1;
  for (int i = 0; i < (int)(N - 1); i++) {
    num *= (i + 1);
    num %= MOD;
  }
  vector<long long> keisuu(N - 1);
  for (int i = 0; i < (int)(N - 1); i++) {
    keisuu[i] = num * finv[N - (i + 1)];
    keisuu[i] %= MOD;
  }
  long long ans = 0;
  for (int i = 0; i < (int)(N - 1); i++) {
    ans += (keisuu[i] * S[i]) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
