n = int(input()) def solve(n): mod = 10**9 + 7 As = [0] * (n + 1) As[1] = 1 cum1 = 1 cum2 = 0 for k in range(2, n + 1): if k % 2: As[k] = (k * cum2) % mod cum1 = (cum1 + As[k]) % mod else: As[k] = (k * cum1) % mod cum2 = (cum2 + As[k]) % mod return As[n] print(solve(n))