#include <iostream>
#include <string>
#define REP(i,n) for(int i=0;i<(n);++i)
#define MOD 1000000007
using namespace std;
typedef long long LL;

int main(){
  int N;
  LL _X[100000], X[100000];
  cin >> N;
  REP(i, N) {
    cin >> _X[i];
  }
  REP(i, N) {
    X[i] = _X[N-1] - _X[N-1-i];
  }
  
  LL kaijo[100001], rkaijo[100001];
  kaijo[0] = 1; rkaijo[N] = 1;
  REP(i, N) {
    kaijo[i+1] = kaijo[i] * (i+1) % MOD;
    rkaijo[N-i-1] = rkaijo[N-i] * (N-i-1) % MOD;
  }
  REP(i, N) {
    
  }
  
  LL ret = 0;
  for(int i = 1; i<N; ++i) {
    LL coff = kaijo[N-i-1] * rkaijo[N-i+1] % MOD;
    ret = (ret + X[i] * coff) % MOD;
  }
  cout << ret << endl;
}