import math

N = int(input())
xList = list(map(int, input().split()))

xrangeList = []
for i in range(0, N - 1):
    xrangeList.append(xList[i + 1] - xList[i])

tmp = math.factorial(N - 1)

resultin = 0
for i in range(0, N - 1):
    if i != 0 and i != N - 2:
        Table = tmp * (i / (N - 2) + 1)
        resultin += xrangeList[i] * Table
    elif i == 0:
        Table = tmp
        resultin += xrangeList[i] * Table
    else:
        Table = tmp * 2 - 1
        resultin += xrangeList[i] * Table
print(int(resultin % (10 ** 9 + 7)))