Help me in solving PETSTORE problem

My issue

My code

#include <iostream>
using namespace std;

int main() {
	int T;
	cin>>T;
	while (T>0) {
	    int N;
	    cin>>N;
	    int a[N];
	    int i;
	    int p;
	    for (i=0;i<N;i++) {
	        cin>>a[i];
	    }
	    if (N%2==0) {
	        for (i=0;i<N;i++) {
	           if (count a[i]%2==0) {
	               cout<<"YES"<<endl;
	           } 
	        }
	    } else {
	        cout<<"NO"<<endl;
	    }
	    }
	// your code goes here
	return 0;
}

Problem Link: PETSTORE Problem - CodeChef

@hussaint
The logic is to count the freq of each number and each freq should be even.
this is my code hope u will get it
include <bits/stdc++.h>
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int a[n];
map<int,int> mp;
for(int i=0;i<n;i++)
{
cin>>a[i];
mp[a[i]]++;
}
int tm=0;
for(auto i:mp)
{
if(i.second%2!=0)
{
tm=1;
break;
}
}
if™
cout<<“NO”;
else
cout<<“YES”;
cout<<endl;
}
return 0;
}