import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

N, = map(int, input().split())
L = [int(v) for v in input().split()]

def f(n):
    v = 0
    for i in range(1, n + 1):
        v += 1 / i
    return v

p = 0
for i in range(N - 1):
    p += (L[i + 1] - L[i]) * f(i + 1)
    
pa = 10 ** 9 + 7
for i in range(1, N):
    p = p * i

print(int(p % pa))
