import sys input = sys.stdin.readline mod = 10**9+7 small = [1, 1, 2, 6, 24, 120] def odd_f(s: int, t: int, mod:int=10**9+7) -> int: if s >= t: return 1 m = (t-2).bit_length() num = (t-s)//2 if m * num < 63: re = s for x in range(s+2, t, 2): re = (re*x) % mod return re mid = (s+num)| 1 u = odd_f(s, mid, mod) v = odd_f(mid, t, mod) return u*v%mod def calc_odd(n: int) -> int: re = 1 s = 3 a = 1 m = n.bit_length()-1 for i in range(m-1, -1, -1): t = ((n>>i)+1) | 1 a *= odd_f(s, t, mod) s = t re *= a return re n = int(input()) if n <= 5: print(small[n]) elif n>=mod: print(0) else: odd = calc_odd(n) two = n-bin(n).count("1") p = pow(2, two, mod) print((odd*p)%mod)