#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << (x) << endl
using namespace std;

const int N = 100005;
const long long mod = 1000000007ll;

int n;
long long x[N], inv[N], fac[N], ans = 0ll;

int main () {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);

	fac[0] = 1ll;
	for (int i = 1; i < n; i++) fac[i] = fac[i - 1] * i % mod;

	inv[1] = 1ll;
	for (int i = 2; i <= n; i++) inv[i] = (mod / i) * (mod - inv[mod % i]) % mod;

	long long now = 0ll;
	for (int i = 1; i < n; i++) now = (now + inv[i]) % mod, ans = (ans + now * fac[n - 1] % mod * (x[i + 1] - x[i]) % mod) % mod;
	printf("%lld\n", ans);
	return 0;
}