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 + Rational(1, n)
end

ans = 0

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

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

puts (ans * v).to_i % MOD
