import sys
read = sys.stdin.buffer.read

sys.setrecursionlimit(100002)
def myfact(n):
    if n < 2:
        return 1
    else:
        return n * myfact(n - 1)
n,*X=map(int,read().split())
last=X[-1]
X=[last-i for i in X[:-1]]
mod = 10**9+7
f=myfact(n-1)%mod
s = sum(f//i*item%mod for i,item in enumerate(X,1))
print(s%mod)