#include <bits/stdc++.h>
using namespace std;
int getInt() {
  int s;
  scanf("%d", &s);
  return s;
}
int facctorialMethod(int k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
static const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < (int)(n); i++) x[i] = getInt();
  double cnt = 0;
  int sec;
  double p;
  for (int i = 0; i < (int)(n - 1); i++) {
    sec = x[i + 1] - x[i];
    p = 0;
    for (int j = 0; j < (int)(i + 1); j++) {
      p += 1.0 / (j + 1);
    }
    cnt += sec * p;
  }
  long long ans;
  ans = cnt * facctorialMethod(n - 1);
  ans %= mod;
  cout << ans << endl;
  return 0;
}
