#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int n;
long long x[100010], S[100010];
struct mod_fac {
 private:
  vector<long long> f, i_f;
  int n;
  long long MOD;

 public:
  void init(int n, long long m) {
    MOD = m;
    f.resize(n + 1, 0);
    i_f.resize(n + 1, 0);
    f[0] = 1;
    for (int i = 0; i < n; i++) {
      f[i + 1] = f[i] * (i + 1) % MOD;
    }
    i_f[n] = power(f[n], MOD - 2);
    for (int i = n - 1; i >= 0; i--) {
      i_f[i] = (i_f[i + 1] * (i + 1)) % MOD;
    }
  }
  long long power(long long a, long long x) {
    if (x == 0) return 1;
    if (x == 1) return a % MOD;
    if (x == 2) return (a * a) % MOD;
    if (x % 2 == 1) return (a * power(power(a, (x - 1) / 2), 2)) % MOD;
    return (power(power(a, x / 2), 2)) % MOD;
  }
  long long fac(int x) { return f[x]; }
  long long invfac(int x) { return i_f[x]; }
  long long comb(int m, int k) {
    if (m < 0 or k < 0) return 0;
    if (m < k) return 0;
    return (((f[m] * i_f[k]) % MOD) * i_f[m - k]) % MOD;
  }
};
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    S[i + 1] = S[i] + x[i];
    S[i + 1] %= mod;
  }
  mod_fac mo;
  mo.init(n, mod);
  long long ans = 0;
  for (int t = 1; t < n - 1; t++) {
    long long T = (long long)t * ((long long)t + 1);
    long long T_inv = mo.power(T, mod - 2);
    ans += T_inv * (S[n - 1] - S[t] - S[n - t - 1] + S[0] + 2 * mod);
    ans %= mod;
  }
  for (int i = 0; i < n - 1; i++) {
    long long inv = mo.power(n - i - 1, mod - 2);
    ans += (x[n - 1] - x[i]) * inv;
    ans %= mod;
  }
  cout << ans * mo.fac(n - 1) % mod << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(50);
  solve();
}
