import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class NotLikePrimeNumber{ public static void main(String[] args) { NotLikePrimeNumber p = new NotLikePrimeNumber(); } public NotLikePrimeNumber(){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); System.out.println(solve(n)); } public String solve(long n) { // 素数のリストを作る // 最低でもsqrt(N)以下の素数を求める // ここではエラトステネスのふるいを使っている boolean[] hurui = new boolean[10000000+1]; Arrays.fill(hurui, true); hurui[0] = hurui[1] = false; ArrayList primeList = new ArrayList(); for(int i=2;i primeFactorList = new ArrayList(); for(long prime: primeList){ while(n%prime == 0){ n /= prime; count++; primeFactorList.add(prime); } if(count>=3) break; } if(count>=3 || (count==2 && n!=1)) return "YES"; else return "NO"; } }