#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

const int N = 1e5 + 5;
const ll mod = 1e9 + 7;

vector < ll > fact(N);

ll pwr (ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}

ll inv (ll a) {
  return pwr(a, mod - 2);
}

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (i * fact[i - 1]) % mod;

  int n;
  cin >> n;
  vector < int > x(n + 1);
  vector < ll > p(n + 1);
  for (int i = 1; i <= n; i++) cin >> x[i];
  ll ans = 0;
  for (int i = 1; i <= n; i++) {
    p[i] = (p[i - 1] + inv(i)) % mod;
  }
  for (int i = 1; i < n; i++) {
    ans = (ans + (((x[i + 1] - x[i]) * p[i]) % mod)) % mod;
  }
  ans = (ans * fact[n - 1]) % mod;
  cout << ans << '\n';
}
