n = int(input()) mod = 10**9 + 7 res = 1 odd_s, even_s = 1, 0 for i in range(2, n + 1): if i % 2 == 0: res = i * odd_s % mod even_s += res even_s %= mod else: res = i * even_s % mod odd_s += res odd_s %= mod print(res)