#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>PP;
const ll MOD = 1000000007;
ll T[100005]={0};
ll S[100005]={0};
ll modpow(ll a, ll mod) {
    ll res = 1;
    ll n=MOD-2;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main(){
  int n;cin >>n;
  for(int i=1;i<=n;i++){
    cin>>T[i];
  }
  for(int i=1;i<n;i++){
   T[i]=T[i+1]-T[i];
  }
  for(int i=1;i<=n;i++){
    S[i]=modpow(i,MOD);
  }
  //cout<<" "<<S[1]<<S[2]<<endl;
  for(int i=2;i<=n;i++){
    S[i]=(S[i-1]+S[i])%MOD;
  }
  ll ans=0;
  for(int i=1;i<n;i++){
    ans+=(T[i]*S[i])%MOD;
    ans%=MOD;
  }
  for(int i=1;i<n;i++){
    ans*=i;
    ans%=MOD;
  }
  cout<<ans<<endl;
}
