#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- int Q; ll N; const int prime_max = 1000000; int NP,prime[100000],divp[prime_max]; map M; void cprime() { if(NP) return; for(int i=2;i=i&&j S,T; void solve() { int i,j,k,l,r,x,y; string s; cprime(); FOR(i,NP) { ll a=1; while(a*prime[i]/prime[i]==a) { a*=prime[i]; if(a>1000000000000000000LL) break; S.insert(a); if(i==0) T.insert(a); } } cin>>Q; while(Q--) { cin>>N; int ok=0; if(N<=100) { FORR(c,S) { if(ok) break; ll left=N-c; if(left<2) break; if(S.count(left)) ok=1; } } else if(N%2==0) { ok=1; } else { FORR(c,T) { if(ok) break; ll left=N-c; if(left<2) break; if(S.count(left)) ok=1; if(left>1000000 && isprime(left)) ok=1; if(left>1000000000000LL && issq(left)) ok=1; } } if(ok) cout<<"Yes"<