#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ans = 0;
  long long MOD = 1000000009;
  int n;
  cin >> n;
  long long fact[100010];
  long long dp[100010];
  dp[0] = 1;
  fact[0] = 1;
  for (long long i = 1; i <= 100000; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= MOD;
  }
  vector<int> p;
  vector<int> d;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    p.push_back(x);
    if (i != 0) {
      d.push_back(p[i] - p[i - 1]);
    }
  }
  long long sum = 0;
  long long memo = 1;
  for (int i = 3; i <= n; i++) {
    memo = dp[0];
    for (int j = 0; j < i - 1; j++) {
      if (j == i - 2) {
        dp[j] = dp[j - 1] + fact[n - 2];
      } else {
        dp[j] = dp[j] * fact[n - 1];
      }
      dp[j] %= MOD;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    ans = ans + (dp[i] * d[i]) % MOD;
  }
  cout << ans;
}
