#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MAX_N = 100100;
const ll MOD = 1e9+7;

ll pMOD( ll a, ll p ){ 
  // aのp乗数をMODで返す
  
  if( p == 0 ){ return 1LL;}
  else if( p == 1 ){ return a;}
  else{
    
    if( p % 2 == 0 ){ return ( pMOD(a,p/2)*pMOD(a,p/2) ) % MOD;}
    else{
      return ( a * ( ( pMOD( a, (p-1)/2 ) * pMOD( a, (p-1)/2 ) )%MOD ) ) % MOD;
    }
    
  }
}

int main(){ 
  
  ll N; cin >> N;
  ll x[MAX_N];
  
  for(ll i = 1; i <= N; i++){ cin >> x[i];}
  
  ll ex = 1LL;
  
  for(ll i = 1; i < N; i++){ ex *= i; ex %= MOD;}
  
  // exは(N-1)! % MOD
  
  ll b[MAX_N];
  
  b[1] = ex;
  
  for(ll i = 1; i+1 < N; i++){ 
    
    b[i+1] = b[i]+ex*pMOD( i+1, MOD-2 );
    
    b[i+1] %= MOD;
    
  }
  
  ll ans = 0;
  
  for(ll i = 1; i < N; i++){ 
    
    ans += (x[i+1]-x[i]) * b[i];
    
    ans %= MOD;
    
  }
  
  
  cout << ans << endl;
  
  return 0;
} 
  
  