import sys
import numpy as np
i8 = np.int64
mod = 10**9 + 7


def main(stdin):
    N, X = stdin[0], stdin[1:]
    D = X[1:] - X[:-1]
    f = 1
    for i in range(1, N):
        f *= i
        f %= mod
    A = np.cumsum(np.array([pow(i, mod - 2, mod) for i in range(N)], dtype=i8))
    A *= f
    A %= mod
    A[1:] *= D
    A %= mod
    print(np.sum(A) % mod)


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', '(i8[:],)')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
else:
    from my_module import main
    stdin = np.array([int(_) for _ in open(0).read().split()])
    main(stdin)
