#include <bits/stdc++.h>
using lint = long long;
using namespace std;
const int MOD = 1000000007;
vector<lint> c;
long long modpow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return res;
}
int main() {
  int N;
  cin >> N;
  vector<int> x(N);
  for (int i = 0; i < (int)(N); i++) cin >> x[i];
  vector<int> q(N - 1);
  for (int i = 0; i < (int)(N - 1); i++) q[i] = x[i + 1] - x[i];
  c.resize(N + 10);
  vector<int> inv(N + 10);
  inv[1] = 1;
  for (int i = 2; i <= N + 1; i++) inv[i] = modpow(i, MOD - 2);
  vector<int> fac(N + 10);
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i <= N; i++) fac[i] = fac[i - 1] * i % MOD;
  c[0] = 1;
  for (int i = 1; i <= N; i++) {
    c[i] = c[i - 1] + inv[i + 1];
    c[i] %= MOD;
  }
  lint res = 0;
  for (int i = 0; i < (int)(N - 1); i++) res += (c[i] * q[i]) % MOD;
  res *= fac[N - 1];
  res %= MOD;
  cout << res << endl;
  return 0;
}
