#include #include #include using namespace std; int f(long long x, const vector &primes) { int ret = 0; for (long long i: primes) { while (x % i == 0) { ret++; x /= i; } } if (x > 2) ret++; return ret; } int main() { int Q; cin >> Q; int N = 1e6 + 1; vector primes; vector is_prime(N, true); is_prime[0] = false; is_prime[1] = false; for (int i = 2; i <= N; i++) { if (is_prime[i]) { primes.push_back((long long)i); for (int j = i + i; j <= N; j += i) { is_prime[j] = false; } } } while (Q--) { long long A; cin >> A; if (f(A, primes) == 3) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }