#include <bits/stdc++.h>
using namespace std;
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
template <typename T>
void view(T e) {
  std::cout << e << std::endl;
}
template <typename T>
void viewarr(T arr[], int n) {
  for (int i = 0; i < n; ++i) std::cout << arr[i] << " ";
  std::cout << std::endl;
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAX_N = 100000;
int N;
long long x[MAX_N];
long long fac[MAX_N];
long long finv[MAX_N];
long long inv[MAX_N];
int main() {
  cin >> N;
  for (int i = (int)(0); i < (int)(N); ++i) cin >> x[i];
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = (int)(2); i < (int)(MAX_N); ++i) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
  long long ans = 0;
  for (int i = (int)(0); i < (int)(N - 1); ++i) {
    long long p = 0;
    for (int j = (int)(0); j < (int)(i + 1); ++j) {
      (p += inv[j + 1]) %= MOD;
    }
    (ans += (x[i + 1] - x[i]) * p) %= MOD;
  }
  for (int i = (int)(1); i < (int)(N); ++i) (ans *= i) %= MOD;
  cout << ans << endl;
  return 0;
}
