def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact
n = int(input())
X = list(map(int, input().split()))
sub = []
sum1 = 0
ans = 0
for i in range(1, n):
  sub.append(X[i]-X[i-1])
for i in range(1,n):
  sum1 = 0
  for j in range(1, i+1):
    sum1 += 1/j
  ans += sub[i-1]*sum1
print(ans*factorial_cor(n-1)/1000000007)