#include <bits/stdc++.h>
using namespace std;

#define MAXN 100*1000 + 5

int fact[MAXN], inv[MAXN], arr[MAXN];
const int mod = 1000*1000*1000 + 7;

int mul(int a, int b) {
	return (1LL * a * b) % mod;
}

int mpow(int a, int n) {
	if(n == 0) return 1;
	int x = mpow(a, n/2);
	x = mul(x, x);
	if(n % 2) x = mul(x, a);
	return x;
}

void add_self(int& a, int b) { a += b; if(a >= mod) a -= mod; }

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	fact[0] = 1;
	for(int i = 1; i < MAXN; i++) {
		fact[i] = mul(i, fact[i-1]);
		inv[i] = inv[i-1];
		add_self(inv[i], mpow(i, mod-2));
	}
	
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	
	int ans = 0;
	for(int i = 1; i < n; i++) {
		int dist = arr[i+1] - arr[i];
		add_self(ans, mul(dist, inv[i]));
	}
	
	ans = mul(ans, fact[n-1]);
	cout << ans << endl;
}
