import sys
import numpy as np
from itertools import permutations
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

MOD = 1000000000 + 7

N, *X = map(int, read().split())
X = np.array(X)

cnt = 1
for i in range(1, N):
    cnt *= i

cnt %= MOD
ans = 0

l = list(permutations(range(1, N)))
for per in l:
    ans += np.abs(np.diff(np.array(list(per) + [N]))).sum()

ans /= len(l) 
ans *= cnt

print(int(ans % MOD))

