N = int(input())
print(int((2**(N-3) * N) % (10**9 + 7)))