#include <bits/stdc++.h>
using namespace std;
long long kai[200001], inv[200001];
int n, k;
long long mod_pow(long long x, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) {
      res = res * x % mod;
    }
    x = x * x % mod;
    n /= 2;
  }
  return res;
}
void init() {
  kai[0] = 1LL;
  for (long long i = 1LL; i <= 200000; i++) {
    kai[i] = kai[i - 1] * i;
    kai[i] %= 1000000007;
  }
  inv[200000] = mod_pow(kai[200000], 1000000007 - 2LL, 1000000007);
  for (long long i = 199999; i >= 0; i--) {
    inv[i] = inv[i + 1] * (i + 1);
    inv[i] %= 1000000007;
  }
}
long long comb(long long r, long long c) {
  long long res;
  res = kai[r];
  res *= inv[c];
  res %= 1000000007;
  res *= inv[r - c];
  res %= 1000000007;
  return res;
}
int main() {
  int x[100000];
  long long ans = 0;
  scanf("%d", &n);
  init();
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i < n - 1; i++) {
    long long a = 0;
    for (int j = i + 1; j < n; j++) {
      long long b = (x[j] - x[j - 1]);
      b *= mod_pow((j - i), 1000000007 - 2LL, 1000000007);
      b %= 1000000007;
      a += b;
      a %= 1000000007;
    }
    ans += a;
    ans %= 1000000007;
  }
  ans *= kai[n - 1];
  ans %= 1000000007;
  printf("%lld\n", ans);
}
