#include <bits/stdc++.h>
using namespace std;
template <class Type>
void line(const Type &a) {
  int cnt = 0;
  for (auto &elem : a) {
    if (cnt++) cout << ' ';
    cout << elem;
  }
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < (n); ++i) cin >> x[i];
  vector<double> dp(n, 0);
  dp[1] = 1;
  for (int i = 2; i < n; ++i) dp[i] = dp[i - 1] + 1.0 / i;
  line(dp);
  double ans = 0;
  for (int i = n - 2; i >= 0; --i) {
    int tmp = x[i + 1] - x[i];
    ans += tmp * dp[n - 1 - i];
  }
  long long tmp = 1;
  for (int i = 1; i < n; ++i) {
    tmp *= i;
    tmp %= ((int)1e9 + 7);
  }
  cout << ans * tmp << endl;
}
