class Integer
  def mod_pow(n, mod)
    x = self
    res = 1

    while n > 0
      res = res * x % mod if n[0] == 1
      x = x * x % mod
      n >>= 1
    end

    res
  end

  def mod_inverse(mod = 10 ** 9 + 7)
    mod_pow(mod - 2, mod)
  end
end

MOD = 10 ** 9 + 7
N = gets.to_i
X = gets.split.map(&:to_i)

D = X.each_cons(2).map { |a, b| b - a }

cn = [0]

1.upto(N) do |n|
  cn << cn.last + n.mod_inverse
  cn[n] %= MOD
end

ans = 0

D.each.with_index(1) do |d, i|
  ans += d * cn[i]
  ans %= MOD
end

v = 1
1.upto(N - 1) do |i|
  v *= i
  v %= MOD
end

puts (ans * v) % MOD
