#include <bits/stdc++.h>
using namespace std;
long long sum[100010];
long long inv(long long x) {
  long long res = 1;
  long long k = (1000000000 + 7) - 2;
  long long y = x;
  while (k) {
    if (k & 1) res = (res * y) % (1000000000 + 7);
    y = (y % (1000000000 + 7) * y % (1000000000 + 7)) % (1000000000 + 7);
    k /= 2;
  }
  return res;
}
int main(void) {
  long long n;
  cin >> n;
  vector<long long> x(n + 1);
  long long ans = 0;
  long long kaijo = 1;
  for (long long i = 1; i <= n - 1; i++) {
    kaijo = kaijo * i;
    kaijo = kaijo % (1000000000 + 7);
  }
  for (long long i = 0; i < n; i++) cin >> x[i + 1];
  for (long long i = 0; i < n; i++) {
    sum[i + 1] = (sum[i] + x[i + 1]) % (1000000000 + 7);
  }
  for (long long p = 1; p <= n - 1; p++) {
    long long tmp = (inv(n - p) * (x[n] - x[p])) % (1000000000 + 7);
    ans = (ans + tmp) % (1000000000 + 7);
  }
  for (long long p = 1; p <= n - 2; p++) {
    long long tmp = inv(p * (p + 1));
    long long tmp1 = sum[n - 1] - sum[p];
    long long tmp2 = sum[n - 1 - p];
    long long tmp3 = (tmp1 - tmp2 + (1000000000 + 7)) % (1000000000 + 7);
    tmp3 = (tmp * tmp3) % (1000000000 + 7);
    ans = (ans + tmp3) % (1000000000 + 7);
  }
  ans = ans * kaijo;
  cout << (ans + (1000000000 + 7)) % (1000000000 + 7) << endl;
  return 0;
}
