import sys
from copy import copy
lines = sys.stdin.readlines()
ds = tuple([int(i) for i in lines[1].split(' ')])
#print(ds)

cache = dict()
def move(ds):
    if len(ds) == 1:
        return 0

    d = 0
    for i in range(len(ds) -1 ):
        nds = list(ds)
        d += nds[i+1] - nds[i]
        nds.pop(i)
        nds = tuple(nds)
        if nds in cache:
            d += cache[nds]
        else:
            t = move(nds)
            cache[nds] = t
            d += t
    #print(d, ds)
    return d / (len(ds) - 1)

r = move(ds)
#print(r)
for i in range( len(ds)-1):
    #print(i+1)
    r *= (i + 1)
r = r % (pow(10,9)+7)
print(int(r))
