N = int(input())
if N == 2:
    print(1)
elif N == 3:
    print(3)
else:
	print((N*(2**(N-3))) % ((10**9)+7))
