#include<bits/stdc++.h> 
#define ll long long
using namespace std;
const ll p = 1e9 + 7, N = 1e5 + 5;
ll x[N], f[N], ans = 0;
int n;
ll solve (ll x) {
	ll ans = 1;
	ll b = p - 2;
	while (b) {
		if (b & 1) ans = ans * x % p;
		x = x * x % p;
		b >>= 1;
	}
	return ans;
}
int main () {
	scanf ("%d", &n);
	for (int i=1;i<=n;i++) scanf ("%lld", &x[i]);
	f[0] = 0;
	for (int i=1;i<n;i++) {
		ll i_1 = solve (1LL * i);
		f[i] = (i_1 % p * (1 + f[i - 1])
		+ (i - 1) * i_1 % p * f[i - 1]) % p;
//		cout << f[i] << endl;
	}
	for (int i=2;i<=n;i++) {	
		ans = (ans + f[i - 1] * (x[i] - x[i - 1]) % p);
	}
	for (int i=1;i<n;i++) {
		ans = (ans * i) % p;
	}
	cout << ans << endl;
}