#include
int one, two, three, four;
int max(int a, int b){
return a>=b?a:b;
}
void checkQuadrant(int x, int y){
if(x>0 && y>0){
one++;
}else if(x<0 && y>0){
two++;
}else if(x<0 && y<0){
three++;
}else if(x>0 && y<0){
four++;
}
}
int main(){
int tc, x, y, n;
scanf("%d", &tc);
for(int i=1;i<=tc;i++){
one=two=three=four=0;
scanf("%d", &n);
for(int j=0;j1?"NO":"YES");
}
return 0;
}