#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; vector factors(ll x) { vector fs; FILE* fp = popen(("factor " + to_string(x)).c_str(), "r"); char buf[1024]; fgets(buf, 1024, fp); pclose(fp); string s = buf; s = s.substr(s.find(":") + 1); stringstream ss(s); ll f; while (ss >> f) { fs.push_back(f); } return fs; } int main() { int Q; cin >> Q; while (Q--) { ll A; cin >> A; if (factors(A).size() == 3) { cout << "Yes\n"; } else { cout << "No\n"; } } }