#include using namespace std; int main() { vector prime(100010, true); for (int i = 2; i < 100010; i++) { if (!prime[i]) { continue; } for (int j = i * 2; j < 100010; j += i) { prime[j] = false; } } vector p; for (int i = 2; i < 100010; i++) { if (prime[i]) { p.push_back((long long)i); } } int q; cin >> q; while (q--) { long long a; cin >> a; int cnt = 0; for (auto x : p) { while (a % x == 0) { a /= x; cnt++; } } if (a > 1) { cnt++; } cout << (cnt == 3 ? "Yes" : "No") << endl; } }