import math
n = int(input())
*x, = map(int, input().split())

p = 1/(n-1)
ev = 0
m = 0
for i in range(n-1):
    m += x[-1]-x[i]
    ev += p*m
    print(m)
inf = 10**9+7
print(ev*math.factorial(n-1)%inf)
