#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long int MAX = 1e9 + 7;
void array_show(int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%d%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(long long int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%lld%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(vector<int> &vec_s, int vec_n = -1, char middle = ' ') {
  if (vec_n == -1) vec_n = vec_s.size();
  for (int i = 0; i < vec_n; i++)
    printf("%d%c", vec_s[i], (i != vec_n - 1 ? middle : '\n'));
}
void array_show(vector<long long int> &vec_s, int vec_n = -1,
                char middle = ' ') {
  if (vec_n == -1) vec_n = vec_s.size();
  for (int i = 0; i < vec_n; i++)
    printf("%lld%c", vec_s[i], (i != vec_n - 1 ? middle : '\n'));
}
long long int pow_mod(long long int p_a, long long int p_n,
                      long long int p_p = 1e9 + 7) {
  long long int p_b = 1, p_t = 1;
  for (; p_b <= p_n; p_b <<= 1)
    ;
  for (p_b >>= 1; p_b > 0; p_b >>= 1) {
    p_t *= p_t;
    if (p_t >= p_p) p_t %= p_p;
    if (p_n & p_b) p_t *= p_a;
    if (p_t >= p_p) p_t %= p_p;
  }
  return p_t;
}
long long int gcd(long long int g_a, long long int g_b) {
  if (g_a < g_b) gcd(g_b, g_a);
  if (g_b == 0) return g_a;
  return gcd(g_b, g_a % g_b);
}
long long int divide(long long int d_a, long long int d_b,
                     long long int d_p = 1e9 + 7) {
  if (d_a >= d_p) d_a %= d_p;
  if (d_a < 0) d_a += d_p;
  if (d_b >= d_p) d_b %= d_p;
  if (d_b < 0) d_b += d_p;
  d_a *= pow_mod(d_b, d_p - 2, d_p);
  return d_a % d_p;
}
long long int pos[110000];
long long int kai[110000];
int main() {
  int n, m;
  int i, j, k;
  long long int a, b, c;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> pos[i];
  }
  long long int sd = 0;
  long long int s = 0;
  kai[0] = 1;
  for (i = 1; i <= n; i++) {
    kai[i] = kai[i - 1] * i;
    if (kai[i] >= MAX) kai[i] %= MAX;
  }
  for (i = 0; i < n - 2; i++) {
    sd += pos[n - 2 - i] - pos[i];
    if (sd >= MAX) sd += MAX;
    if (sd < 0) sd += MAX;
    a = divide(kai[n - 1], i + 1);
    a = divide(a, i + 2);
    s += sd * a;
    if (s >= MAX) s %= MAX;
  }
  for (i = 0; i < n - 1; i++) {
    a = divide(kai[n - 1], n - 1 - i);
    a *= pos[n - 1] - pos[i];
    if (a >= MAX) a %= MAX;
    s += a;
  }
  s %= MAX;
  cout << s << endl;
}
