#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <cstdio>
#include <cstring>

using namespace std;

const int MOD = 1000000007;
const int MAX = 110000;

long long fac[MAX], finv[MAX], inv[MAX];

void Init() {
	fac[0] = fac[1] = inv[1] = finv[0] = finv[1] = 1;
	for (int i = 2; i < MAX; ++i) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

int main() {
	Init();
	int n; cin >> n;
	vector<int> x(n);
	for (auto& a : x) cin >> a;
	long long ans = 0, t = 0;
	for (int i = 1; i < n; ++i) {
		(t += inv[i]) %= MOD;
		(ans += t * (x[i] - x[i - 1])) %= MOD;
	}
	(ans *= fac[n - 1]) %= MOD;
	cout << ans << endl;

	return 0;
}