#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll MOD=1e9+7;
const int INF=1<<30;

ll inv[100010];

ll kaijo(ll n){
  ll ans=1;
  for(int i=1;i<=n;i++){
    ans=ans*i%MOD;
  }
  return ans;
}

int main(){
  inv[1]=1;
  int N; cin >> N;
  ll rui=kaijo(N-1);
  vector<ll> x(N);
  rep(i,N) cin >> x[i];
  ll ans=0;
  for(int i=0;i<=N-1;i++){
    if(i==0){
      ans+=(x[N-1]-x[i])*rui%MOD;
      continue;
    }
    inv[i+1]=MOD-inv[MOD%(i+1)]*(MOD/(i+1))%MOD;
    ans+=(x[N-1]-x[i])*(rui*inv[i+1]%MOD)%MOD;
  }
  cout << ans%MOD<< endl;
  
}