#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using ll = long long;
constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);
using namespace std;
void scans(string& str) {
  char c;
  str = "";
  scanf("%c", &c);
  if (c == '\n') scanf("%c", &c);
  while (c != '\n' && c != -1) {
    str += c;
    scanf("%c", &c);
  }
}
void scanc(char& str) {
  char c;
  scanf("%c", &c);
  if (c == -1) return;
  while (c == '\n') {
    scanf("%c", &c);
  }
  str = c;
}
double acot(double x) { return PI / 2 - atan(x); }
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll number1, ll number2) {
  return number1 / gcd(number1, number2) * number2;
}
ll LSB(ll n) { return (n & (-n)); }
template <int mod>
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(ll y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt& operator+=(const ModInt& p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt& operator-=(const ModInt& p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt& operator*=(const ModInt& p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  ModInt& operator/=(const ModInt& p) {
    *this *= p.inverse();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt& p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt& p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt& p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt& p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt& p) const { return x == p.x; }
  bool operator!=(const ModInt& p) const { return x != p.x; }
  bool operator>(const ModInt& p) const { return x > p.x; }
  bool operator<(const ModInt& p) const { return x < p.x; }
  bool operator<=(const ModInt& p) const { return x <= p.x; }
  bool operator>=(const ModInt& p) const { return x >= p.x; }
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  friend ostream& operator<<(ostream& os, const ModInt& p) { return os << p.x; }
  friend istream& operator>>(istream& is, ModInt& a) {
    ll t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  static int get_mod() { return mod; }
};
using modint = ModInt<MOD>;
using Modint = ModInt<998244353>;
int main() {
  ll n;
  scanf("%lld", &n);
  vector<modint> a(n), sa(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  for (int i = n - 1 - 1; i >= 0; --i) {
    sa[i] = a[i + 1] - a[i] + sa[i + 1];
  }
  for (int i = n - 1 - 1; i >= 0; --i) {
    sa[i] += sa[i + 1];
  }
  modint ans = 0;
  for (int i = 0; i < (n - 1); ++i) {
    modint tmp = sa[i];
    tmp /= (n - 1 - i);
    ans += tmp;
  }
  for (int i = 0; i < (n - 1); ++i) ans *= (i + 1);
  cout << ans << endl;
  return 0;
}
