#include <bits/stdc++.h>
using namespace std;
long long fact[100005];
long long a[100005], dp[100005], sumn[100005];
long long inv[100005], invsum[100005];
int main() {
  ios::sync_with_stdio(0);
  fact[0] = 1ll;
  for (int i = 1; i < 100005; i++) fact[i] = (fact[i - 1] * i) % 1000000007ll;
  sumn[0] = 0ll;
  for (int i = 1; i < 100005; i++) sumn[i] = (sumn[i - 1] + i) % 1000000007ll;
  inv[0] = 0ll;
  invsum[0] = 0ll;
  for (int i = 1; i < 100005; i++) {
    inv[i] = (invsum[i - 1] + fact[i - 1]) % 1000000007ll;
    invsum[i] = (invsum[i - 1] + inv[i]) % 1000000007ll;
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    dp[i] = (dp[i - 1] * i) % 1000000007ll;
    long long adder = ((a[i] - a[i - 1]) * invsum[i]) % 1000000007ll;
    dp[i] = (dp[i] + adder) % 1000000007ll;
  }
  cout << dp[n - 1] << endl;
  return 0;
}
