#include #include #include #include #include #include using namespace std; #define sz(v) (int)(v.size()) #define rep(i,a,n) for(int i=a;i=a;--i) #define mem(a,t) memset(a,t,sizeof(a)) #define pb push_back #define mp make_pair #define fi first #define se second #define N 10005 int main() { //freopen("in.txt","r",stdin); int T,n,t; scanf("%d",&T); while(T--){ scanf("%d",&n); int f1=0,f2=0; rep(i,0,n){ scanf("%d",&t); if(t==1) f2=1; if(t==0) f1=1; } if(f1&&f2) cout<<"YES"; else cout<<"NO"; cout<