#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 9e18;
ll n, x[200001];
ll modpow(ll x, ll n) {
  if (n == 0) return 1;
  return modpow(x * x % 1000000007, n / 2) * (n & 1 ? x : 1) % 1000000007;
}
ll modinv(ll a) { return modpow(a, 1000000007 - 2); }
inline ll inverse(ll a, ll m) {
  ll b = m, x = 1, y = 0;
  while (b) {
    ll t = a / b;
    swap(a -= t * b, b);
    swap(x -= t * y, y);
  }
  return (x % m + m) % m;
}
vector<ll> fact, inv_fact;
void init_fact(ll n) {
  fact.resize(n);
  fact[0] = 1;
  for (ll i = 1; i < n; i++) {
    fact[i] = i * fact[i - 1] % 1000000007;
  }
  inv_fact.resize(n);
  inv_fact[n - 1] = inverse(fact[n - 1], 1000000007);
  for (ll i = n - 2; i >= 0; i--) {
    inv_fact[i] = (i + 1) * inv_fact[i + 1] % 1000000007;
  }
}
ll nPr(ll n, ll r) {
  if (n < r || n < 0 || r < 0) return 0;
  return fact[n] * inv_fact[n - r] % 1000000007;
}
ll nCr(ll n, ll r) {
  if (n < r || n < 0 || r < 0) return 0;
  return fact[n] * inv_fact[r] % 1000000007 * inv_fact[n - r] % 1000000007;
}
ll nHr(ll n, ll r) {
  if (n == 0 && r == 0) return 1;
  return nCr(n + r - 1, r);
}
signed main() {
  cin >> n;
  for (ll i = 0; i < n; i++) cin >> x[i + 1];
  init_fact(n);
  ll inv_n[n];
  for (ll i = 1; i < n; i++) {
    inv_n[i] = inverse(i, 1000000007);
  }
  ll ret = 0;
  for (ll i = 0; i < n; i++) {
    for (ll j = 1; j <= i; j++) {
      ret += (x[i + 1] - x[i]) * inv_n[j];
      ret %= 1000000007;
    }
  }
  ret *= fact[n - 1];
  ret %= 1000000007;
  cout << ret << endl;
  return 0;
}
