import math
N = int(input())
x = list(map(int,input().split()))
kitai=0

for i in range(N-1):
  kitai +=(x[i+1]*(1/(N-1)))
#  print(x[i+1])
y = math.factorial(N-1)
a = kitai*y
z = 10**9+7
#print(x)
print(int(a%z))
#print(a)
#print(y)
#print(z)
#print(kitai)
#print(kaijo)
