#include using namespace std; vector v1; vector v2; void solve() { long long a; cin>>a; v1.push_back(1); for(long long x=2;x*x<=a;x++) { if(a%x == 0) { v1.push_back(x); if(x * x != a) v2.push_back(a/x); } } reverse(v2.begin(),v2.end()); for(auto x:v2) v1.push_back(x); reverse(v1.begin(),v1.end()); a--; for(auto x:v1) { if(a >= x) a = max(a - x, x - 1); } if(a == 0) cout<<"Yes"<<'\n'; else cout<<"No"<<'\n'; v1.resize(0); v2.resize(0); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--) solve(); return 0; }