N = int(eval(input()))

X = list(map(int,input().split()))

MOD = 10**9+7



MAXN = N+5

fac = [1,1] + [0]*MAXN

finv = [1,1] + [0]*MAXN

inv = [0,1] + [0]*MAXN

for i in range(2,MAXN+2):

    fac[i] = fac[i-1] * i % MOD

    inv[i] = -inv[MOD%i] * (MOD // i) % MOD

    finv[i] = finv[i-1] * inv[i] % MOD



c = 0

f = fac[N-1]

ans = 0

for i in range(1,N):

    c += f * inv[i]

    c %= MOD

    ans += c * (X[i] - X[i-1])

    ans %= MOD

print(ans)

N = int(eval(input()))

X = list(map(int,input().split()))

Y = [b-a for a,b in zip(X,X[1:])]



MOD = 10**9+7

MAXN = N+5

fac = [1,1] + [0]*MAXN

inv = [0,1] + [0]*MAXN

for i in range(2,MAXN+2):

    fac[i] = fac[i-1] * i % MOD

    inv[i] = -inv[MOD%i] * (MOD // i) % MOD



ans = m = 0

for i,y in enumerate(Y):

    m += fac[N-1] * inv[i+1]

    ans += y*m

    ans %= MOD

print(ans)
N = int(eval(input()))
X = list(map(int, input().split()))
MOD = 10**9 + 7
MAXN = N + 5
fac = [1, 1] + [0] * MAXN
finv = [1, 1] + [0] * MAXN
inv = [0, 1] + [0] * MAXN
for i in range(2, MAXN + 2):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = -inv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD
c = 0
f = fac[N - 1]
ans = 0
for i in range(1, N):
    c += f * inv[i]
    c %= MOD
    ans += c * (X[i] - X[i - 1])
    ans %= MOD
print(ans)

N = int(eval(input()))
X = list(map(int, input().split()))
Y = [b - a for a, b in zip(X, X[1:])]
MOD = 10**9 + 7
MAXN = N + 5
fac = [1, 1] + [0] * MAXN
inv = [0, 1] + [0] * MAXN
for i in range(2, MAXN + 2):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = -inv[MOD % i] * (MOD // i) % MOD
ans = m = 0
for i, y in enumerate(Y):
    m += fac[N - 1] * inv[i + 1]
    ans += y * m
    ans %= MOD
print(ans)

+Y = [b - a for a, b in zip(X, X[1:])] -finv = [1, 1] + [0] * MAXN -    finv[i] = finv[i - 1] * inv[i] % MOD -c = 0 -f = fac[N - 1] -ans = 0 -for i in range(1, N): -    c += f * inv[i] -    c %= MOD -    ans += c * (X[i] - X[i - 1]) +ans = m = 0 +for i, y in enumerate(Y): +    m += fac[N - 1] * inv[i + 1] +    ans += y * m