#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int
import math
from itertools import accumulate

def mod_factorial(n):
    value = 1
    for i in range(n,0,-1):
        value*=i
        value%=MOD

    return value

def solve(N: int, x: "List[int]"):
    gyakusu = []
    dif_x = []
    for i in range(1,N):
        gyakusu.append(1/i)
        dif_x.append(x[i]-x[i-1])
    
    accum_gyakusu = list(accumulate(gyakusu))
    answer = 0

    for i in range(N-1):
        answer += accum_gyakusu[i]*dif_x[i]
        answer %= MOD
    
    print(int(answer*mod_factorial(N-1)%MOD))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, x)

if __name__ == '__main__':
    main()
