#include #include #include #include #include #include #include #include //#include using namespace std; #define FOR(i, n, m) for(int i = n; i <= m; i++) #define REP(i, n, m) for(int i = n; i >= m; i--) #define PB push_back #define MP make_pair typedef long long ll; typedef unsigned long long ull; typedef pair PII; typedef pair PLI; const int maxn = 200010; const int maxm = 100010; int main(){ int t; cin>>t; int n, x; while(t--){ cin>>n; bool flag1 = false, flag0 = false; while(n--) { cin>>x; if(x==1) flag1=true; if(x == 0) flag0 = true; } cout<<(flag1&&flag0?"YES":"NO")<