#include<iostream>
#include<cstdio>

using namespace std;

inline int read()
{
	int f = 1,x = 0;
	char ch;
	do
	{
		ch = getchar();
		if(ch == '-') f = -1;
	}while(ch < '0' || ch > '9');
	do
	{
		x = (x<<3) + (x<<1) + ch - '0';
		ch = getchar();
	}while(ch>='0'&&ch<='9');
	return f*x;
}

const int MAXN = 100000 + 10;
const int MOD = 1e9 + 7;

inline long long Pow(long long a,long long b)
{
	long long  ans = 1,mul = a;
	while(b)
	{
		if(b&1) ans = (ans * mul) % MOD;
		mul = (mul *mul)%MOD;
		b>>=1;	
	}
	return ans;
}

int n;
long long a[MAXN],x[MAXN];
long long inv[MAXN];

int main()
{
	n = read();
	for(register int i=1;i<=n;i++) a[i] = read();
	for(register int i=1;i<n;i++) x[i] = a[i+1] - a[i];
	for(register int i=1;i<=n;i++) inv[i] = (inv[i-1] + Pow(i,MOD-2))%MOD;
	long long ans = 0;
	for(register int i=1;i<n;i++) ans = (ans + x[i]*inv[i]%MOD)%MOD;
	for(register int i=1;i<n;i++) ans = (ans * i)%MOD;
	cout<<ans<<endl;
}