#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
using namespace std;
#define LL long long 
#define LD long double
const int mod=1e9+7;
int n;
LL x[100005],cheng[100005],inv[100005];
LL poww(LL x,LL nn)
{
	LL res=1;
	while(nn)
	{
		if(nn&1)res=res*x%mod;
		x=x*x%mod;
		nn>>=1;
	}
	return res;
}
LL sum[100005];
int main()
{
	scanf("%d",&n);cheng[0]=1;
	for(int i=1;i<=n;i++)
		cheng[i]=cheng[i-1]*i%mod;
	for(int i=1;i<=n;i++)
		sum[i]=(sum[i-1]+poww(i,mod-2))%mod;
	inv[n]=poww(cheng[n],mod-2);
	for(int i=n-1;i>=0;i--)
		inv[i]=inv[i+1]*(i+1)%mod;
	for(int i=1;i<=n;i++)
		scanf("%lld",&x[i]);
	for(int i=n;i;i--)
		x[i]=(x[i]-x[i-1]+mod)%mod;
	LL ans=0;
	//for(int i=1;i<n;i++)
	//	ans=(ans+x[i+1]*cheng[n-1]%mod)%mod;
	for(int i=1;i<n;i++)
		ans=(ans+x[i+1]*sum[i]%mod)%mod;
	cout<<ans*cheng[n-1]%mod<<endl;
	return 0;
}