#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]
    MOD = 10**9+7
    from math import factorial
    def calc(k,slimes):
        # print(slimes)
        if k == N-1:
            return 0
        r = 0
        # for i in range(N-k-1):
        #     slimes2 = slimes[:]
        #     r = (slimes2[i+1]-slimes2[i]) / float(N-k-1)
        #     slimes2.pop(i)
        #     r += calc(k+1,slimes2) % MOD
        i = N-k-2
        slimes2 = slimes[:]
        r = (slimes2[i+1]-slimes2[i]) / float(N-k-1)
        slimes2.pop(i)
        r += calc(k+1,slimes2) % MOD
        return r
    N = II()
    X = LMIIS()
    print(int(calc(0,X)* factorial(N-1)% MOD))




if __name__ == '__main__':
    main()