mod = 10**9+7
n = int(input())
r = n
for i in range(n-3):
    r *= 2
    r %= mod
print(r)