#include <bits/stdc++.h>
using namespace std;
long long i, j, k, m = 1, n, t, r[100005], x[100005];
long double d, p, s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (; i++ < n;) {
    cin >> x[i];
    if (i < n) m = m * i % 1000000007;
  }
  for (i = 0; ++i < n;) {
    for (r[i] = m; r[i] % i;) r[i] += 1000000007;
    r[i] /= i;
    r[i] += r[i - 1];
    r[i] %= 1000000007;
    t = (t + r[i] * (x[i + 1] - x[i])) % 1000000007;
  }
  printf("%d", t);
}
