#include <iostream>
#include <vector>
#include <algorithm>
typedef long long ll;
using namespace std;
#define rep(i, n) for(ll i = 0LL; i < (n); i++)
using Graph = vector<vector<int>>;
ll mod = 1000000007LL;
vector<ll> y;

ll modpow(ll x, int p = mod - 2) {
	if (p == 0) return 1;
	ll temp = modpow(x, p / 2);
	temp = temp * temp % mod;
	if (p % 2) temp = temp * x % mod;
	return temp;
}

int main(void) {
	ll n;
	cin >> n;
	vector<ll> x(n), dif(n), inv(n), inv_sum(n, 0), fact(n, 1);
	rep(i, n) {
		cin >> x[i];
	}
	
	rep(i, n - 1) {
		dif[i + 1] = x[i + 1] - x[i];
	}

	rep(i, n - 1) {
		inv[i + 1] = modpow(i + 1);
		inv_sum[i + 1] = (inv_sum[i] + inv[i + 1]) % mod;		
	}

	rep(i, n - 1) {
		fact[i + 1] = fact[i] * (i + 1) % mod;
	}

	ll ans = 0;
	rep(i, n - 1) {
		ll temp = (inv_sum[i + 1] * dif[i + 1]) % mod;
		ans += temp;
		ans %= mod;
	}
	ans = ans * fact[n - 1] % mod;

	cout << ans << endl;
	return 0;
}