import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    long mod = 1_000_000_000l + 7;
    long result = n;
    if (n == 2){
        System.out.println(1);
        return;
    }
    for (int i = 0; i < n-3; i++){
        result *= 2;
        result %= mod;
    }
        System.out.println(result);
    }
}