N=int(input())
x=list(map(int,input().split()))
ans=0
MOD=10**9+7

import math


for i in range(2,N+1):#iは右端からの数
    #(x[-1]-x[-i])/i+(x[-2]-x[-i])/i......(x[-i+1]-x[-i])/i
    for j in range(i-1):
        ans+=(x[-j-1]-x[-i])/(i-1)
print(int((ans*math.factorial(N-1))%MOD))