#include using namespace std; typedef long long ll; const int INF = 1<<30; const long long INFLL = 1LL<<60; const int MOD = 998244353; ll q; vector primes; bool is_prime(ll n){ if (n < 2) return false; for (int i = 2; i < min((ll)sqrt(n) + 5, n); i++){ if (n % i == 0) return false; } return true; } void make_primes(){ for (int i=2; i < 10000; i++){ if (is_prime(i)) primes.push_back(i); } } bool is_429(ll n){ int cnt = 0; for (int p : primes){ while (n % p == 0){ cnt++; n /= p; if (cnt == 2) break; } if (cnt == 2){ //cout << n << endl; if (is_prime(n)) return true; else return false; } } return false; } int main() { cin >> q; make_primes(); while (q--){ ll a; cin >> a; cout << (is_429(a) ? "Yes" : "No") << endl; } return 0; }