#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;

// gcd
LL gcd(LL a, LL b) {
	while(b){
		auto t=a%b;
		a=b;
		b=t;
	}
	return a;
}

//lcm
LL lcm(LL a, LL b) {return a/gcd(a,b)*b;}

// a>=0, b>=0, x*a+y*b=gcd>=0, a>0,b>0=>abs(y)<=a,abs(x)<=b
LL gcdex(LL a,LL b,LL& x, LL& y){
	LL ax=1,ay=0;
	LL bx=0,by=1;
	while(b){
		LL r=a/b;
		LL t=a-r*b; a=b; b=t;
		LL tx=ax-r*bx; ax=bx; bx=tx;
		LL ty=ay-r*by; ay=by; by=ty;
	}
	x=ax;
	y=ay;
	return a;
}
LL modinv(LL a, LL m){
	LL x,y;
	gcdex(a,m,x,y);
	if(x<0){
		x+=m;
	} else if(x>=m){
		x-=m;
	}
	return x;
}
const long long M = 1000000007;

void solve(long long N, std::vector<long long> x){
	vector<LL> dif;
	LL ret=0;
	LL s=0;
	int u=0,v=N-2;
	for(int i=1;i<N-1;i++){
		LL a=modinv(i,M);
		LL b=modinv(i+1,M);
		s+=M+x[v]-x[u];
		s%=M;
		u++;
		v--;
		//cerr << s << ", " << i << ", " << i+1<<endl;
		ret+=s*a%M*b%M;
		ret%=M;
	}
	for(int i=1;i<N;i++){
		LL a=modinv(i,M);
		ret+=(x[N-1]-x[N-1-i])*a%M;
		//cerr << x[N-1]-x[N-1-i] << ", " << i << endl;
		ret%=M;
	}
	for(int i=1;i<N;i++){
		ret*=i;
		ret%=M;
	}
	cout << ret << endl;

}

int main(){
#if 0
	int a[5]={1,2,3,4,5};
	int v[7]={};
	do{
