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