n = int(input()) dp = [1, 0] result = 1 mod = 10**9+7 for i in range(2, n+1): result = (dp[i%2]*i)%mod dp[(i+1)%2] += result print(result)