#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
typedef long long ll;
int n;
ll inv[maxn],sum[maxn],a[maxn];
ll fpow(ll a,ll b) {
	ll r = 1;
	while (b) {
		if (b & 1) r = r * a % mod;
		b >>= 1;
		a = a * a % mod;
	}
	return r;
}
int main() {
	inv[0] = 1;
	for (int i = 1; i <= maxn - 10; i++)
		inv[i] = inv[i - 1] * i % mod;
	scanf("%d",&n);
	for (int i = 1; i <= n; i++)
		scanf("%lld",&a[i]);
	for (int i = 1; i <= n; i++)
		sum[i] = (sum[i - 1] + a[i]) % mod;
	ll ans = 0;
	for (int t = 1; t <= n - 2; t++) {
		ans = (ans + inv[n - 1] * fpow(t,mod - 2) % mod * fpow(t + 1,mod - 2) % mod * 
				((sum[n - 1] - sum[t] - sum[n - 1 - t] + 2 * mod) % mod) % mod) % mod;
	}
	for (int i = 1; i <= n - 1; i++) {
		ans = (ans + (a[n] - a[i]) * inv[n - 1] % mod * fpow(n - i,mod - 2) % mod) % mod;
	}
	printf("%lld\n",ans);
	return 0;
}