import java.util.*;
import java.io.*;

public class stadium_akov {
	FastScanner in;
	PrintWriter out;

	final long mod = 1000 * 1000 * 1000 + 7;
	
	long pow(long x, long n) {
		if (n == 0) return 1;
		long res = pow(x, n / 2);
		res = (res * res) % mod;
		if (n % 2 == 1) {
			res = (res * x) % mod;
		}
		return res;
	}
	
	public void solve() throws IOException {
		long n = in.nextLong();
		out.println(pow(2, n - 1));
	}

	public void run() {
		try {
			in = new FastScanner(new File("stadium.in"));
			out = new PrintWriter(new File("stadium.out"));

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}

	public static void main(String[] arg) {
		new stadium_akov().run();
	}
}