#!/bin/python3 import sys n = int(input().strip()) m = list(map(int, input().strip().split(' '))) # your code goes here print((2**(n-1)) % (10**9+7))