#include <bits/stdc++.h>
using namespace std;
const int P = 1000000007;
const int N = 100010;
int n, x[N], d[N], di[N], pi[N], f[N], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  for (int i = 1; i <= n - 1; i++) d[i] = x[i + 1] - x[i];
  pi[0] = 1;
  for (int i = 1; i <= n; i++) pi[i] = (long long)pi[i - 1] * i % P;
  di[n] = 1;
  for (int i = n - 1; i >= 1; i--) di[i] = (long long)di[i + 1] * i % P;
  for (int i = 1; i <= n - 1; i++) {
    f[i] = ((long long)f[i - 1] * i % P + pi[i - 1]) % P;
  }
  for (int i = 1; i <= n - 1; i++) {
    ans = (ans + ((long long)d[i] * f[i] * di[i + 1]) % P) % P;
  }
  ans = (ans % P + P) % P;
  printf("%d\n", ans);
  return 0;
}
