#include using namespace std; bool ok(long long n) { long long cnt = 0; for (long long i = 2; i * i <= n; i++) { while (n % i == 0) { cnt++; if (cnt > 3) { return false; } n /= i; } } if (n > 1) { cnt++; } return (cnt == 3LL); } int main() { int q; cin >> q; while (q--) { long long a; cin >> a; cout << (ok(a) ? "Yes" : "No") << endl; } }