#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;
static const ll LOGN=55;

ll moP(ll x, ll n) {
  ll res=1;
  while(n>0) {
    if(n&1) moC(res, *, x);
    moC(x, *, x);
    n>>=1;
  }
  return res;
}

int main(void) {
  ll N;
  cin >> N;
  ll i;
  ll x[MAX];
  ll t[MAX];
  ll s[MAX]={};
  ll KAI=1; //=(N-1)!
  
  for(i=0; i<N; i++) cin >> t[i];
  for(i=0; i<N-1; i++) x[i+1]=t[i+1]-t[i];
  for(i=1; i<N; i++) moC(KAI, *, i);
  
  for(i=1; i<N; i++) s[i]=(s[i-1]+moP(i, MOD-2))%MOD;
  for(i=1; i<N; i++) moC(s[i], *, KAI);
  
  ll ans=0;
  for(i=1; i<N; i++) {
    moC(ans, +, x[i]*s[i]%MOD);
  }
  
  pt(ans);
  
  
  
}



