#include #define N 100000 int n, t, a[ N + 1]; bool has1, has0; int main() { scanf("%d", &t); while(t--) { scanf("%d", &n); has1 = false; has0 = false; for(int i = 0;i < n;i++){ scanf("%d", &a[i]); if(a[i] == 1){ has1 = true; } if(a[i] == 0){ has0 = true; } } if(has1 && has0){ printf("YES\n"); } else { printf("NO\n"); } } return 0; }