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

public class stadium_ats {
    StringTokenizer st;
    PrintWriter out;
    BufferedReader br;

    private final long BASE = (long) 1e9 + 7;

    private String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public static void main(String[] args) {
        new stadium_ats().run();
    }

    private long pow(long num, long deg) {
        if (deg == 0) {
            return 1;
        }
        long ans = 1;
        if (deg % 2 == 1) {
            ans = num;
        }
        return (ans * pow((num * num) % BASE, deg / 2)) % BASE;
    }

    private void solve() throws IOException {
        long deg = nextLong();
        out.println(pow(2, deg - 1));
    }

    public void run() {
        try {
            br = new BufferedReader(new FileReader("stadium.in"));
            out = new PrintWriter("stadium.out");

            solve();

            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
