n = int(input()) a = [0] * (n + 1) a[1] = 1 mod = 1000000007 odd, even = 0, 0 for i in range(2, n + 1): if i % 2 == 0: odd += a[i - 1] a[i] = i * odd % mod else: even += a[i - 1] a[i] = i * even % mod print(a[n])