import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int q = Integer.parseInt(br.readLine()); PrintWriter pw = new PrintWriter(System.out); for (int z = 0; z < q; z++) { long a = Long.parseLong(br.readLine()); boolean flg = false; label: for (long i = 2; i * i * i <= a; i++) { if (a % i == 0) { a /= i; for (long j = i; j * j <= a; j++) { if (a % j == 0) { a /= j; if (a > 1) { flg = true; } for (long k = j; k * k <= a; k++) { if (a % k == 0) { flg = false; break label; } } break label; } } break; } } if (flg) { pw.println("Yes"); } else { pw.println("No"); } } pw.flush(); br.close(); } }