import fileinput as fi
IN = fi.input()

x = int(IN.readline())

print(x * 2 ** (x - 3) % (10**9 + 7))