#include using namespace std; using ll = long long; using P = pair; vector

factorize(ll n) { vector

res; for (ll i = 2; i*i <= n; ++i) { if (n%i != 0) continue; res.emplace_back(i, 0); while (n%i == 0) { n /= i; res.back().second++; } } if (n != 1) res.emplace_back(n, 1); return res; } void solve() { ll n; cin >> n; auto fs = factorize(n); int cnt = 0; for (auto [_, x] : fs) { cnt += x; } if (cnt == 3) puts("Yes"); else puts("No"); } int main() { int t; cin >> t; while (t--) solve(); return 0; }