import java.math.BigInteger;
import java.util.Scanner;

public class Proglute {
    public static final BigInteger MODULO_VEC = new BigInteger("1000000007");
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int sides = s.nextInt();
        BigInteger velmiBigNumberLeboSranda = new BigInteger("2").modPow(new BigInteger(sides - 3 + ""), MODULO_VEC).multiply(new BigInteger(sides + "")).mod(MODULO_VEC);
        System.out.println(velmiBigNumberLeboSranda);
    }
}
