output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      x_1 x_2 \ldots x_N
attempt: from heapq import heappush, heappop, heapify
  from collections import deque, defaultdict, Counter
  import itertools
  from itertools import permutations, combinations, groupby
  import sys
  import bisect
  import string
  import math
  import time
  import random
  
  
  def S_():
      return input()
  
  
  def LS():
      return [i for i in input().split()]
  
  
  def I():
      return int(input())
  
  
  def MI():
      return map(int, input().split())
  
  
  def LI():
      return [int(i) for i in input().split()]
  
  
  def LI_():
      return [int(i) - 1 for i in input().split()]
  
  
  def NI(n):
      return [int(input()) for i in range(n)]
  
  
  def NI_(n):
      return [int(input()) - 1 for i in range(n)]
  
  
  def StoI():
      return [ord(i) - 97 for i in input()]
  
  
  def ItoS(nn):
      return chr(nn + 97)
  
  
  def LtoS(ls):
      return "".join([chr(i + 97) for i in ls])
  
  
  def GI(V, E, Directed=False, index=0):
      org_inp = []
      g = [[] for i in range(n)]
      for i in range(E):
          inp = LI()
          org_inp.append(inp)
          if index == 0:
              inp[0] -= 1
              inp[1] -= 1
          if len(inp) == 2:
              a, b = inp
              g[a].append(b)
              if not Directed:
                  g[b].append(a)
          elif len(inp) == 3:
              a, b, c = inp
              aa = (inp[0], inp[2])
              bb = (inp[1], inp[2])
              g[a].append(bb)
              if not Directed:
                  g[b].append(aa)
      return g, org_inp
  
  
  def bit_combination(k, n=2):
      rt = []
      for tb in range(n**k):
          s = [tb // (n**bt) % n for bt in range(k)]
          rt += [s]
      return rt
  
  
  def show(*inp, end="\n"):
      if show_flg:
          print(*inp, end=end)
  
  
  YN = ["Yes", "No"]
  mo = 10**9 + 7
  inf = float("inf")
  l_alp = string.ascii_lowercase
  u_alp = string.ascii_uppercase
  ts = time.time()
  # sys.setrecursionlimit(10**5)
  input = lambda: sys.stdin.readline().rstrip()
  
  
  def ran_input():
      import random
  
      n = random.randint(4, 16)
      rmin, rmax = 1, 10
      a = [random.randint(rmin, rmax) for _ in range(n)]
      return n, a
  
  
  class Comb:
      def __init__(self, n, mo=10**9 + 7):
          self.fac = [0] * (n + 1)
          self.inv = [1] * (n + 1)
          self.fac[0] = 1
          self.fact(n)
          for i in range(1, n + 1):
              self.fac[i] = i * self.fac[i - 1] % mo
              self.inv[n] *= i
              self.inv[n] %= mo
          self.inv[n] = pow(self.inv[n], mo - 2, mo)
          for i in range(1, n):
              self.inv[n - i] = self.inv[n - i + 1] * (n - i + 1) % mo
          return
  
      def fact(self, n):
          return self.fac[n]
  
      def invf(self, n):
          return self.inv[n]
  
      def comb(self, x, y):
          if y < 0 or y > x:
              return 0
          return self.fac[x] * self.inv[x - y] * self.inv[y] % mo
  
  
  show_flg = False
  show_flg = True
  
  ans = 0
  
  
  n = I()
  x = LI()
  p = permutations(range(n - 1))
  cm = Comb(n + 20)
  
  StrN = [0] * (n + 10)
  StrN[1] = 1
  StrN[0] = 0
  
  
  def St(n):
      if n == 1:
          return 1
      if StrN[n] != 0:
          return StrN[n]
      else:
          # a(n+1)=(n+1)*a(n)+n!.
          StrN[n] = (n) * St(n - 1) + cm.fac[n - 1]
          return StrN[n]
  
  
  St(n)
  
  Pat = [0] * (n + 1)
  for i in range(n):
      Pat[i] = StrN[i] * cm.fac[n - 1] * cm.inv[i] % mo
  # show('Pat',Pat)
  # show('St',StrN)
  
  for i in range(n - 1):
      ans += (x[i + 1] - x[i]) * Pat[i + 1]
      ans %= mo
  
  print(ans % mo)
  # show(SSS)
  
problem_description: Statement
  
  There are N slimes standing on a number line. The i-th slime from the left is
  at position x_i.
  
  It is guaruanteed that 1 \leq x_1 < x_2 < \ldots < x_N \leq 10^{9}.
  
  Niwango will perform N-1 operations. The i-th operation consists of the
  following procedures:
  
    * Choose an integer k between 1 and N-i (inclusive) with equal probability.
    * Move the k-th slime from the left, to the position of the neighboring slime to the right.
    * Fuse the two slimes at the same position into one slime.
  
  Find the total distance traveled by the slimes multiplied by (N-1)! (we can
  show that this value is an integer), modulo (10^{9}+7). If a slime is born by
  a fuse and that slime moves, we count it as just one slime.
samples: [{"input": "3\n    1 2 3", "output": "5\n    \n\n  * With probability \\frac{1}{2}, the leftmost slime is chosen in the first operation, in which case the total distance traveled is 2.\n  * With probability \\frac{1}{2}, the middle slime is chosen in the first operation, in which case the total distance traveled is 3.\n  * The answer is the expected total distance traveled, 2.5, multiplied by 2!, which is 5.\n\n* * *"}, {"input": "12\n    161735902 211047202 430302156 450968417 628894325 707723857 731963982 822804784 880895728 923078537 971407775 982631932", "output": "750927044\n    \n\n  * Find the expected value multiplied by (N-1)!, modulo (10^9+7)."}]