import sys
read = sys.stdin.buffer.read

n,*X=map(int,read().split())
mod = 10**9+7
last=X[-1]
X=[last-i for i in X[:-1]]
l=1
left=[1]
for i in range(1, n-1):
  l=l*i
  left.append(l)
r=1
right=[1]
for i in range(n-1, 1, -1):
  r*=i
  right.append(r)
right.reverse()
flst=[i*j for i,j in zip(left,right)]
s = sum(i*j%mod for i,j in zip(X,flst))
print(s%mod)