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

const int N = 100005, P = 1000000007;
int n, x[N], h[N];

int power(int a, int x) {
	int ans = 1;
	for (; x; x >>= 1, a = 1ll * a * a % P)
		if (x & 1) ans = 1ll * ans * a % P;
	return ans;
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) scanf("%d", x + i), h[i] = (h[i - 1] + power(i, P - 2)) % P;
	int ans = 0;
	for (int i = 1; i < n; ++i) ans = (ans + 1ll * (x[i + 1] - x[i]) * h[i]) % P;
	for (int i = 1; i < n; ++i) ans = 1ll * ans * i % P;
	printf("%d\n", ans);
}
