#include using i64 = long long; constexpr int N = 1e5; std::bitset st; std::vector primes; int solve() { i64 n; std::cin >> n; int cnt = 0; for (auto &p: primes) { while (n % p == 0) { n /= p; cnt += 1; } if (cnt > 3) break; } if (n > 1) cnt += 1; std::cout << (cnt == 3 ? "Yes" : "No") << '\n'; return 0; } int main() { std::cin.tie(nullptr)->sync_with_stdio(false); int _; std::cin >> _; for (i64 i = 2; i <= N; ++i) { if (st[i]) continue; for (i64 j = i * i; j <= N; j += i) st[j] = 1; primes.push_back(i); } while (_--) solve(); return 0; }