#include <bits/stdc++.h>
using namespace std;
constexpr int64_t MOD = 1000000007;
inline int64_t pat(int64_t fn, int64_t idx) {
  int64_t res = 0;
  for (int i = 1; i <= idx; i++) {
    res += fn / i;
    res %= MOD;
  }
  return res;
}
inline int64_t factorial(int64_t K) {
  int64_t res = 1;
  for (int i = 1; i <= K; i++) {
    res *= i;
    res %= MOD;
  }
  return res;
}
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  int32_t N;
  cin >> N;
  vector<int64_t> dx(N - 1);
  int64_t prev = 0;
  cin >> prev;
  for (int i = 0; i < N - 1; i++) {
    int64_t cur = 0;
    cin >> cur;
    dx[i] = cur - prev;
    prev = cur;
  }
  int64_t factN = factorial(N - 1);
  vector<int64_t> pattern(N - 1, 0);
  pattern[0] = factN;
  int64_t res = factN * dx[0];
  res %= MOD;
  for (int i = 1; i < N - 1; i++) {
    pattern[i] = pattern[i - 1] + factN / (i + 1);
    res += dx[i] * pattern[i];
  }
  cout << res % MOD << endl;
  return 0;
}
