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())
cnt = 1
for i in range(1, N):
    cnt *= i
ans = 0

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

for i in range(1, N):
    for j in range(1, i+1):
        ans += j * (cnt / i)

print(int(ans % MOD))

