import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np MOD = 10 ** 9 + 7 N = int(read()) if N == 1: print(1) exit() M = N // 2 def update_dp(f, g): newf = np.zeros(len(f) + 1, np.int64) newg = newf.copy() newg[:-1] = f + f + g newf[1:] = f + g newf %= MOD newg %= MOD return newf, newg f = np.array([0, 1], np.int64) g = np.array([0, 0], np.int64) for _ in range((N - 2) // 2): f, g = update_dp(f, g) A = f + g if N & 1: f, g = update_dp(f, g) B = f + g def convolve(A, B): A1, A2 = divmod(A, 1 << 16) B1, B2 = divmod(B, 1 << 16) X = np.convolve(A1, B1) % MOD Z = np.convolve(A2, B2) % MOD Y = (np.convolve(A1 + A2, B1 + B2) - X - Z) % MOD return ((X << 32) + (Y << 16) + Z) % MOD A = convolve(A, B) fact = [1, 1] for n in range(2, N + 10): fact.append(fact[-1] * n % MOD) fact = np.array(fact, dtype=np.int64) A *= fact[:N+1] A[1 - (N & 1)::2] *= - 1 A %= MOD answer = A.sum() % MOD print(answer)