#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {-1, 1, 0, 0, 1, -1, 1, -1};
const int SIZE = 10000;
long long mod_pow(long long x, long long n, long long mod) {
  if (n == 0) return 1;
  long long res = mod_pow((x * x) % mod, n / 2, mod);
  if (n & 1) res = (res * x) % mod;
  return res;
}
signed main() {
  long long N;
  cin >> N;
  vector<long long> A, D;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (A.size()) D.push_back(a - A.back());
    A.push_back(a);
  }
  long long C[SIZE] = {1, 1};
  for (int i = 2; i < N; i++) {
    C[i] = C[i - 1] + mod_pow(i, 1000000007 - 2, 1000000007);
    C[i] %= 1000000007;
  }
  long long ans = 0;
  for (int i = 0; i < N - 1; i++) {
    ans += D[i] * C[i + 1];
    ans %= 1000000007;
  }
  for (int i = 1; i <= N - 1; i++) {
    ans *= i;
    ans %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
