#include <bits/stdc++.h>
using namespace std;
using Complex = complex<double>;
using ll = long long;
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
double PI = acos(-1.0);
ll x[101010], sum[101010], fact[101010];
ll mod = 1000000007;
ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> x[i];
  for (int i = 0; i < N; i++) {
    sum[i + 1] = sum[i] + x[i];
    sum[i + 1] %= mod;
  }
  fact[0] = 1;
  for (ll i = 1; i < 101010; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
  ll ans = 0;
  for (ll k = 2; k < N; k++) {
    ll temp = modpow(k * (k - 1LL), mod - 2);
    ll sum1 = (sum[N - 1] - sum[k - 1] + 5LL * mod) % mod;
    ll sum2 = (sum[N - k] - sum[0] + 5LL * mod) % mod;
    sum1 -= sum2;
    sum1 += 5LL * mod;
    sum1 %= mod;
    temp *= sum1;
    temp %= mod;
    ans += temp;
    ans %= mod;
  }
  for (ll k = 2; k <= N; k++) {
    ll temp = modpow(k - 1, mod - 2);
    ll sum1 = (x[N - 1] - x[N - k]);
    temp *= sum1;
    temp %= mod;
    ans += temp;
  }
  ans *= fact[N - 1];
  cout << ans % mod << endl;
  return 0;
}
