#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define getmid(l,r) ((l) + ((r) - (l)) / 2) #define MEM(a,b) memset(a,b,sizeof(a)) #define MP(a,b) make_pair(a,b) #define PB push_back #define X first #define Y second const double eps = 1e-8; const double pi = acos(-1.0); const int INF = 0x3f3f3f3f; const int MAXN = 100010; int T,n; int A[MAXN]; int main(){ scanf("%d",&T); while(T--){ scanf("%d",&n); int f = 0; int zero = 0; for(int i = 1; i <= n; ++i){ int a; scanf("%d",&a); if(a == 1) f = 1; if(a == 0) zero = 1; } if(f && zero) printf("YES\n"); else printf("NO\n"); } return 0; }