#include <bits/stdc++.h>
using namespace std;
const long long MAX = 200000;
const long long INF = 1001001001;
const long long MOD = 1000000007;
long long N, ans = 0, tmp = 0;
vector<long long> A;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (long long i = 2; i < MAX; 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 COM(long long n, long long k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
signed main() {
  cin >> N;
  COMinit();
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    a -= tmp;
    if (i) A.push_back(a);
    tmp = a + tmp;
  }
  long long s = 0;
  for (long long i = 1; i < N; i++) {
    s += fac[N - 1] / i;
    s %= MOD;
    ans += s * A[i - 1];
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
