#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); vector tb(100001, true); vector p; p.reserve(9592); tb[0] = tb[1] = false; for(int i = 2; i <= 100000; i++){ if(!tb[i]) continue; p.emplace_back(i); for(int j = i; j <= 100000; j += i) tb[j] = false; } int Q; cin >> Q; while(Q--){ ll v; cin >> v; int cnt = 0; for(int i = 0; i < 9592 && p[i] * p[i] <= v; i++){ while(v % p[i] == 0){ v /= p[i]; cnt++; } } if(v != 1) cnt++; cout << (cnt == 3 ? "Yes" : "No") << '\n'; } }