#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int q; cin >> q; while (q--) { ll a; cin >> a; int cnt = 0; for (ll i = 2; i * i <= a; i++) { while (a % i == 0) { a /= i; cnt++; } if (cnt > 3) break; } if (a > 1) cnt++; cout << (cnt == 3 ? "Yes" : "No") << endl; } return 0; }