import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class stadium_av {

	final static String fileName = "stadium";
	final static long mod = 1000 * 1000 * 1000 + 7;

	public static long solve(long n) {
		return BigInteger.valueOf(2)
				.modPow(BigInteger.valueOf(n - 1), BigInteger.valueOf(mod))
				.longValue();
	}

	public static void main(String[] args) throws FileNotFoundException {
		Scanner in = new Scanner(new File(fileName + ".in"));
		PrintWriter out = new PrintWriter(new File(fileName + ".out"));
		
		long n = in.nextLong();
		assert (1 <= n && n <= 1e18);
		
		out.println(solve(n));
		out.close();
	}
}
