N, *L = map(int, open(0).read().split())
MOD = 10**9+7
D = [b-a for a,b in zip(L,L[1:])]
f = [1]
for i in range(1,N+1):
  f.append(f[-1]*i%MOD)
C = [1]
for i in range(1,N-1):
  C.append((C[-1]+pow(i+1,MOD-2,MOD))%MOD)
ans = sum(d*c for d,c in zip(D,C))%MOD
print(ans*f[N-1]%MOD)