import math
N = int(input())
x = list(map(int,input().split()))
m = 10**9 +7
k = 1/N
F = math.factorial(N-1)
All = list(map(lambda x: x/(N-1),[x for x in range(2, N+1)]))
res = sum(All)
# res = All*k
# F = math.factorial(N-1)
print((res*F)%m)