import copy
import numpy as np
# import fractions
import itertools

n = int(input())

l = input().split()

for i in range(n):
    l[i] = int(l[i])

new_l = [l[n-1]-i for i in l]
# print(new_l)

new_l.pop()

ruiseki = np.cumsum(new_l)
# print(ruiseki)
allSum = sum(ruiseki)
# ans = allSum/fractions.factorial(n)
factorial = len(list(itertools.permutations(new_l)))
# print(factorial)

ans = int(allSum/(n-1) * factorial)
print(ans % 1000000007)
