import java.util.Scanner; // Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, // then press Enter. You can now see whitespace characters in your code. public class Main { public static void main(String[] args) { // Press Alt+Enter with your caret at the highlighted text to see how // IntelliJ IDEA suggests fixing it. Scanner vstup = new Scanner(System.in); long n = vstup.nextLong(); if (n == 2) { System.out.println("1"); return; } if (n == 3) { System.out.println("3"); return; } long vysledok = n*umocni(2, n-3); vysledok = vysledok % ((long)Math.pow(10, 9) + 7); System.out.println(vysledok); // int i = Math.toDegrees(...) } private static long umocni(long zaklad, long mocnina) { long zaklad2 = zaklad; for (long i = 1; i < mocnina; i++) { zaklad = zaklad * zaklad2; zaklad = zaklad % ((long) Math.pow(10, 9) + 7); } return zaklad; } // BufferedReader reader = // new BufferedReader(new InputStreamReader(System.in)); }