#include <bits/stdc++.h>
constexpr auto Z = 1000000007;
using namespace std;
int main() {
  int n, length = 0;
  cin >> n;
  const int pro = n - 1;
  vector<int> x(n);
  for (auto& i : x) {
    cin >> i;
  }
  for (int i = 0; i < n - 1; i++) {
    length += (x[n - 1] - x[i]) / pro;
  }
  for (int i = 1; i <= n - 1; i++) {
    length *= i;
    length %= Z;
  }
  cout << length << endl;
}
