-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
42 lines (41 loc) · 704 Bytes
/
B.cpp
File metadata and controls
42 lines (41 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,n;
cin>>t;
while(t--)
{
cin>>n;
int a[n],c1=0,c2=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(a[i]==1)
c1++;
else if(a[i]==2)
c2++;
}
if(c1%2==0 && c2%2==0)
{
cout<<"YES";
}
else if(c1%2==0 && c2%2!=0)
{
if(c1==0)
{
cout<<"NO";
}
else
{
cout<<"YES";
}
}
else
{
cout<<"NO";
}
cout<<endl;
}
return 0;
}