#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
using namespace std;
const int max_comb = 120000;
vector<long long> fac(max_comb + 1);
vector<long long> ifac(max_comb + 1);
long long mpow(long long x, long long n) {
  long long ans = 1;
  while (n != 0) {
    if (n & 1) ans = ans * x % MOD;
    x = x * x % MOD;
    n = n >> 1;
  }
  return ans;
}
long long minv(long long x) { return mpow(x, MOD - 2); }
long long comb(int a, int b) {
  if (a == 0 && b == 0) return 1;
  if (a < b || a < 0) return 0;
  long long tmp = ifac[a - b] * ifac[b] % MOD;
  return tmp * fac[a] % MOD;
}
long long perm(int a, int b) {
  if (b == 0) return 1;
  if (a < b || a < 0) return 0;
  long long tmp = ifac[a - b] % MOD;
  return tmp * fac[a] % MOD;
}
void pre_comb() {
  fac[0] = 1;
  ifac[0] = 1;
  for (int i = 0; i < max_comb; i++) {
    fac[i + 1] = fac[i] * (i + 1) % MOD;
    ifac[i + 1] = ifac[i] * minv(i + 1) % MOD;
  }
  return;
}
int main(int argc, char* argv[]) {
  int n;
  scanf("%d", &n);
  vector<long long> a(n), s(n + 1);
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    s[i + 1] = s[i] + a[i];
  }
  pre_comb();
  vector<long long> p(n - 1), sp(n);
  for (i = 0; i < n - 1; i++) {
    p[i] = perm(i, i) * minv(perm(i + 2, i + 2)) % MOD;
    p[i] = p[i] * perm(n - 1, n - 1) % MOD;
    sp[i + 1] = (sp[i] + p[i]) % MOD;
  }
  long long ans = 0;
  int j;
  for (i = 0; i < n - 1; i++) {
    {
      long long tmp = (MOD + perm(n - 1, n - 1) - sp[n - i - 2]) % MOD;
      long long ans0 = tmp * ((a[n - 1] - a[i]) % MOD) % MOD;
      ans = (ans + ans0) % MOD;
    }
    if (i < n - 1) {
      long long tmp = p[i];
      long long aaa = s[n - 1] - s[i + 1] - s[n - i - 2];
      long long ans0 = tmp * aaa % MOD;
      ans = (ans + ans0) % MOD;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
