#pragma comment(linker, "/STACK:102400000,102400000") #include #include #include #include #include using namespace std; int n; int main() { int z; scanf("%d",&z); while(z--) { scanf("%d",&n); bool b0=0,b1=0; while(n--) { int x; scanf("%d",&x); if(x==0) b0=1; if(x==1) b1=1; } if(b0&b1) printf("YES\n"); else printf("NO\n"); } return 0; }