#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>

using namespace std;
typedef long long ll;

/////////////         modの計算

#define MOD_IS_PRIME
const ll mod = 1000000007LL;

inline ll mod_adjust(ll a) {//	余りをとる(0～mod-1に調整する)
	if (a >= mod) {
		return a % mod;
	}
	if (a < 0) {
		a *= -1;
		a--;
		if (a >= mod) { a %= mod; }
		a++;
		return mod - a;
	}
	return a;
}
inline ll mod_add(ll a, ll b) {//	足し算
	return mod_adjust(a % mod + b % mod);
}
inline ll mod_sub(ll a, ll b) {//	引き算
	return mod_adjust(a % mod - b % mod);
}
inline ll mod_multi(ll a, ll b) {//	掛け算
	return mod_adjust(mod_adjust(a) * mod_adjust(b));
}
inline ll mod_inv(ll a) {//	逆元
	const ll inv_max = 3000000;
	static vector<ll> inv;
	ll k = mod_adjust(a);

	if (k <= inv_max) {
		ll M = inv.size();
		if (M <= k) {
			if (M == 0) { inv.push_back(0); M++; }
			if (M == 1) { inv.push_back(1); M++; }

			for (ll i = M; i <= k; i++) {
				ll p = mod / i;
				ll q = mod - (p * i);
				inv.push_back(((mod - p) * inv[q]) % mod);
			}
		}
		return inv[k];
	}

	ll p = mod, q = k, m = 0, n = 1, r, c;

	ll s = inv.size();
	while (q > 1) {
		if (q < s) {
			return (n * inv[q]) % mod;
		}
		c = p / q;
		r = p - (q * c);
		c = mod_adjust(m - n * c);
		p = q, m = n, q = r, n = c;
	}
	return mod_adjust(n);
}
inline ll mod_div(ll a, ll b) {//	割り算
	return (mod_adjust(a) * mod_inv(b)) % mod;
}
inline ll mod_pow(ll x, ll n) {//	累乗
	if (n < 0) {
		return mod_pow(mod_inv(x), -n);
	}

#ifdef MOD_IS_PRIME
	n = n % (mod - 1);
#endif

	if (n == 0) {
		return 1;
	}
	if (n == 1) {
		return mod_adjust(x);
	}
	if (n % 2 == 0) {
		ll k = mod_pow(x, n / 2);
		return mod_multi(k, k);
	}
	else {
		ll k = mod_pow(x, n / 2);
		return mod_multi(mod_multi(k, k), x);
	}
}
inline ll mod_log(ll a, ll x) {
	ll A = sqrt(mod);
	ll B = (mod + A - 1) / A;
	map<ll, ll> mp1, mp2;
	ll p0 = a;
	ll q0 = mod_pow(a, -A);
	ll p = 1;
	ll q = x;
	for (int i = 0; i < A; i++) {
		mp1.insert({ p, i });
		p = (p * p0) % mod;
	}
	for (int i = 0; i < B; i++) {
		mp2.insert({ q, A * i });
		q = (q * q0) % mod;
	}
	auto itr1 = mp1.begin();
	auto itr2 = mp2.begin();
	while (itr1 != mp1.end() && itr2 != mp2.end()) {
		if (itr1->first < itr2->first) {
			itr1++;
		}
		else if (itr1->first == itr2->first) {
			return itr1->second + itr2->second;
		}
		else {
			itr2++;
		}
	}
	return 0;
}

inline ll factorial(ll n, bool inverse = false) {//	階乗を計算する
	static vector<ll> factorial, factorial_inv;

	ll M = factorial.size();
	if (M <= n) {
		if (M == 0) { factorial.push_back(1); factorial_inv.push_back(1); M++; }
		if (M == 1) { factorial.push_back(1); factorial_inv.push_back(1); M++; }

		for (ll i = M; i <= n; i++) {
			factorial.push_back((factorial.back() * i) % mod);
			factorial_inv.push_back((factorial_inv.back() * mod_inv(i)) % mod);
		}
	}
	if (inverse == true) {
		return factorial_inv[n];
	}
	else {
		return factorial[n];
	}
}
inline ll mod_combination(ll n, ll r) {//	nCr	を計算する
	if (n < 0 || r < 0 || r > n) { return 0; }
	if (n >= mod) { return 0; }
	if (r < 0) { return 0; }

	return mod_multi(factorial(n), mod_multi(factorial(n - r, true), factorial(r, true)));
}

int main() {
	ll N; cin >> N;

	vector<ll> A(N);
	for (int i = 0; i < N; i++) { cin >> A[i]; }

	ll ans = 0;
	vector<ll> B(N - 1);
	for (int i = N - 2; i >= 0; i--) {
		B[i] = A[i + 1] - A[i];
	}
	ll buf = 0;
	for (ll i = 0; i < N - 2; i++) {
		buf = mod_add(buf, mod_inv((i + 1)));
		ans = mod_add(ans, mod_multi(B[i], buf));
	}
	buf = 0;
	for (int i = 1; i <= N - 1; i++) {
		buf = mod_add(buf, mod_inv(i));
	}
	ans = mod_add(ans, mod_multi(B[N - 2], buf));
	ans = mod_multi(ans, factorial(N - 1));

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4980