#include #include using namespace std; int readint(){ int ch=getchar(),ret=0; while(ch<'0' || ch>'9') ch=getchar(); while(ch>='0' && ch<='9') ret=ret*10+ch-'0',ch=getchar(); return ret; } long long a[100009],cur; int T,n; int main(){ #ifdef YJQ_LOCAL freopen(".in","r",stdin); #endif scanf("%d",&T); while(T--){ n=readint(); bool flag=false,flag0=false; for (int i=1;i<=n;i++){ a[i]=readint(); if (a[i]==1){ flag=true; } if (a[i]==0) flag0=true; } if (flag && flag0){ printf("YES\n"); } else printf("NO\n"); } }