stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define f first

#define s second

#define mp make_pair

typedef long long int ll;

const int N=1e5+5;

int n,vis[N];

pair< pair<int,int>, int >  p[N];

priority_queue < pair < int, pair<int,int> > > q;

ll ans;

int par(int x){

    return((vis[x]==-1||vis[x]==x)? x:par(vis[x]));

}

int main(){

    //cin.tie(NULL);

   // cout.tie(NULL);

    //ios_base::sync_with_stdio(false);

    memset(vis,-1,sizeof vis);

    cin>>n;

    for(int i=0;i<n;i++){

        cin>>p[i].f.f>>p[i].f.s;

        p[i].s=i;

    }

    sort(p,p+n);

    for(int i=1;i<n;i++)

        q.push( mp( -(p[i].f.f-p[i-1].f.f),mp(p[i].s,p[i-1].s)));



    for(int i=0;i<n;i++)

        swap(p[i].f.f,p[i].f.s);

    sort(p,p+n);

    for(int i=1;i<n;i++)

        q.push( mp(-(p[i].f.f-p[i-1].f.f),mp(p[i].s,p[i-1].s)));

    while(q.size()){

        pair< int, pair<int,int> > x=q.top();

        q.pop();

        //cout<<x.s.f<<" "<<vis[x.s.f]<<" "<<x.s.s<<" "<<vis[x.s.s]<<" "<<x.f<<'\n';

        vis[x.s.f]=par(x.s.f);

        vis[x.s.s]=par(x.s.s);

        if(vis[x.s.f]==vis[x.s.s])

            continue;

        ans+=-x.f;

        vis[vis[x.s.f]]=vis[x.s.s];

    }

    cout<<ans<<'\n';

    return 0;

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define INF 0x3f3f3f3f



const int MOD = 1e9+7;

const int N = 200000+5;

const int dx[] = {-1,1,0,0,-1,-1,1,1};

const int dy[] = {0,0,-1,1,-1,1,-1,1};

using namespace std;

struct Edge

{

    int x,y;

    int dis;

    Edge(){}

    Edge(int x,int y,int dis):x(x),y(y),dis(dis) {}

    bool operator <(const Edge &rhs)const

    {

        return dis<rhs.dis;

    }

} edge[N];

int tot;

struct Node

{

    int x,y;

} node[N];

int fa[N];

bool cmpX(int a,int b)

{

    return node[a].x<node[b].x;

}

bool cmpY(int a,int b)

{

    return node[a].y<node[b].y;

}

int Find(int x)

{

    if(fa[x]!=x)

        return fa[x]=Find(fa[x]);

    return x;

}

int n;

int Kruskal()

{

    for(int i=1; i<=n; i++)

        fa[i]=i;

    int mst=0;

    sort(edge+1,edge+1+tot);

    for(int i=1; i<=tot; i++)

    {

        int x=Find(edge[i].x);

        int y=Find(edge[i].y);

        if(x!=y)

        {

            mst+=edge[i].dis;

            fa[x]=y;

        }

    }

    return mst;

}

int main()

{

    scanf("%d",&n);

    for(int i=1; i<=n; i++)

        scanf("%d%d",&node[i].x,&node[i].y);

    for(int i=1; i<=n; i++)

        fa[i]=i;

    sort(fa+1,fa+1+n,cmpX);

    for(int i=1; i<n; i++)

    {

        int x=fa[i];

        int y=fa[i+1];

        int dis=node[y].x-node[x].x;

        edge[++tot]=Edge(x,y,dis);

    }

    for(int i=1; i<=n; i++)

        fa[i]=i;

    sort(fa+1,fa+1+n,cmpY);

    for(int i=1; i<n; i++)

    {

        int x=fa[i];

        int y=fa[i+1];

        int dis=node[y].y-node[x].y;

        edge[++tot]=Edge(x,y,dis);

    }

    int mst=Kruskal();

    printf("%d\n",mst);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

    using namespace std;

     

    int main()

    {

        int x,a,b;

        while(cin>>x>>a>>b){

            x-=a;

            x%=b;

            cout<<x<<endl;

        }

        return 0;

    }

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int a,b,x;

    scanf("%d%d%d",&x,&a,&b);

    printf("%d\n",((x-a)%b));

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

     using namespace std;



     int main()

     {

         int y,a,b;

         while(cin>>y>>a>>b){

             y-=a;

             y%=b;

             cout<<y<<endl;

         }

         ;

     }

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int a,b,x;

    scanf("%d%d%d",&x,&a,&b);

    printf("%d\n",((x-a)%b));

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

        int x,a,b,c=0,d;

        cin>>x>>a>>b;

        c=x-a;

        cout<<c%b<<endl;

        return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int a,b,x;

    scanf("%d%d%d",&x,&a,&b);

    printf("%d\n",((x-a)%b));

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define  ll long long int

main()

{

    ll x,a,b;

    cin>>x>>a>>b;

x=x-a;

b=x%b;

cout<<b<<endl;





    }


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int a,b,x;

    scanf("%d%d%d",&x,&a,&b);

    printf("%d\n",((x-a)%b));

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

long long n,a,b;

int main()

{

    cin>>n>>a>>b;

    n-=a;

    n-=n/b*b;

    cout<<n;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int a,b,x;

int main(){

	scanf("%d%d%d",&x,&a,&b);

	x-=a;

	x-=x/b*b;

	printf("%d",x);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int x,a,b;

int main(){

	cin>>x>>a>>b;

	cout<<(x-a)%b<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int a,b,x;

int main(){

	scanf("%d%d%d",&x,&a,&b);

	x-=a;

	x-=x/b*b;

	printf("%d",x);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int x,a,b;

	cin>>x>>a>>b;

	x-=a;

	cout<<x-x/b*b<<endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    long long n,a,b;

    scanf("%lld%lld%lld",&n,&a,&b);

    printf("%d\n",(n-a)%b);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <algorithm>

int n,a,b;

using namespace std; 

int main()

{

	cin>>n>>a>>b;

	n-=a;

	n%=b;

	cout<<n;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int a,b,x,i;

int main()

{

	scanf("%d%d%d",&x,&a,&b);

	x-=a;

	x%=b;

	printf("%d",x);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

    int x,a,b;

    cin>>x>>a>>b;

    x-=a;

    x%=b;

    cout<<x<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int a,b,x,i;

int main()

{

	scanf("%d%d%d",&x,&a,&b);

	x-=a;

	x%=b;

	printf("%d",x);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;

long long sums,n,x;





int main() {

	sums=0;

	cin>>n;

	for(long long i=0;i<n;i++)

	{

		cin>>x;

		sums+=x%2;

	}

	if(sums%2==0)

		cout<<"YES";

	else cout<<"NO";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)

#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a, value) memset(a, value, sizeof(a))



#define SZ(a) (int) a.size()

#define ALL(a) a.begin(),a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const LL INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



int main()

{

	//freopen("in.txt", "r", stdin);

	//ios::sync_with_stdio(false); cin.tie(0);



	int n;

	scanf("%d", &n);



	if (n == 1)

	{

		cout<<"YES"<<endl;

		return 0;

	}



	int cnt = 0;

	FOR (i, 0, n)

	{

		int x;

		scanf("%d", &x);

		if (x & 1) cnt ^= 1;

	}



	if (cnt) cout<<"NO"<<endl;

	else cout<<"YES"<<endl;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<iostream>

using namespace std;

const int MAXN=100000;

int a[MAXN+5];

int n,cnt1,cnt2;

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&a[i]);

		if(a[i]%2!=0)

			cnt1++;//奇数个数

		else

			cnt2++;//偶数个数

	}

	if(cnt1%2==0)

		printf("YES\n");

	else

		printf("NO\n");

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>//coded by Nurstan ^_^



#define ll long long

#define pb push_back



#define mp make_pair

#define lb lower_bound

#define ub upper_bound



#define all(x) x.begin(), x.end()

#define F first

#define S second



// fixed << setprecision

// next_permutation(a, a + n)

// set <int> :: iterator it = x.begin(); it != x.end(); it ++



using namespace std;



inline void boost(){

	ios_base::sync_with_stdio(0);

	cin.tie(0);

}



int main(){

	boost();

	//freopen("input.txt", "r", stdin);

	//freopen("output.txt", "w", stdout);

	int n;

	cin >> n;

	int l = 0, r = 0;

	for(int i = 0; i < n; i ++) {

		int k;

		cin >> k;

		if(k % 2 != 0) {

			r ++;

		}

	}

	if(r % 2 == 0) {

		cout << "YES";

		return 0;

	}

	else {

		cout << "NO";

		return 0;

	}

	exit(0);

}




// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int n,ans;

int main(){

	cin>>n;

	while(n--){

		int x;

		cin>>x;

		if(x&1) ++ans;

	}

	if(ans&1) printf("NO\n");

	else printf("YES\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

int n;

int x,y;

int main(){

	scanf("%d",&n);

	for(int i=1;i<=n;i++){

		int a;

		scanf("%d",&a);

		if(a&1)x++;

		else y++;

	}

	if(x&1)cout<<"NO"<<endl;

	else cout<<"YES"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<algorithm>

#include<cmath>

using namespace std;

int n,a[100004],sum=0;

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&a[i]);

		if(a[i]%2!=0) sum++;

	}

	if(sum%2==0) cout<<"YES";

	else cout<<"NO";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main(){

	unsigned int n;

	unsigned long long int a,ev=0,o=0;

	scanf("%u",&n);

	while(n--){

		scanf("%llu",&a);

		if(a&1)

		++ev;

		else

		++o;

	}

	if(ev%2==0)

	printf("YES");

	else

	printf("NO");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n,sj,so;

	sj=0;

	so=0;

	scanf("%d",&n);

	int a[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a[i]);

		if(a[i]%2==0)

		{

			so=so+a[i];

		}

		else

		{

			sj=sj+a[i];

		}

	}

	if(so%2==sj%2)

	{

		printf("%s","YES");

	}

	else

	{

		printf("%s","NO");

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>



int main(){

    int N,Sum=0;

    scanf("%d",&N);

    for(int i=1;i<=N;i++){

        int x;

        scanf("%d",&x);

        Sum+=x%2;

    }

    if(Sum%2) puts("NO");

    else puts("YES");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n,sj;

	sj=0;

	scanf("%d",&n);

	int a[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a[i]);

		if(a[i]%2!=0)

		{

			sj=sj+a[i];

		}

	}

	if(sj%2==0)

	{

		printf("%s","YES");

	}

	else

	{

		printf("%s","NO");

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>



int main(){

    int N,Sum=0;

    scanf("%d",&N);

    for(int i=1;i<=N;i++){

        int x;

        scanf("%d",&x);

        Sum+=x%2;

    }

    if(Sum%2) puts("NO");

    else puts("YES");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios::sync_with_stdio(false);

	int n;

	cin>>n;

	int sum=0;

	for(int i=1;i<=n;i++)

	{

		int x;

		cin>>x;

		sum+=x;

		sum%=2;

	}

	if(sum)cout<<"NO"<<endl;else cout<<"YES"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>



int main(){

    int N,Sum=0;

    scanf("%d",&N);

    for(int i=1;i<=N;i++){

        int x;

        scanf("%d",&x);

        Sum+=x%2;

    }

    if(Sum%2) puts("NO");

    else puts("YES");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//fifer a tak luboin

#include <bits/stdc++.h>

#define ll long long

#define pb push_back

#define mb make_pair

#define se second

#define fi first

#define INF 1e18



using namespace std;





int a[100100];

int cnt1=0;

int cnt2=0;

int main()

{



	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    //freopen("arithmetic.in", "r", stdin);

    //freopen("arithmetic.out", "w", stdout);

    int n;

    cin>>n;



    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(a[i]%2==0)

        {

            cnt2++;

        }

        else

        {

            cnt1++;

        }

    }



    if(cnt1%2==0 && cnt2%2==0)

    {

        cout<<"YES";

    }

    else if(cnt1%2!=0 && cnt2%2!=0)

    {

        cout<<"NO";

    }

    else if(cnt1%2==0 && cnt2%2!=0)

    {

        cout<<"YES";

    }

    else if(cnt1%2!=0 && cnt2%2==0)

    {

        cout<<"NO";

    }















































return 0;}


// Optimized solution to the same problem (faster):
#include<cstdio>



int main(){

    int N,Sum=0;

    scanf("%d",&N);

    for(int i=1;i<=N;i++){

        int x;

        scanf("%d",&x);

        Sum+=x%2;

    }

    if(Sum%2) puts("NO");

    else puts("YES");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <functional>

#include <algorithm>

#include <iostream>

#include <cstring>

#include <cstdlib>

#include <cassert>

#include <sstream>

#include <numeric>

#include <string>

#include <vector>

#include <cstdio>

#include <bitset>

#include <cmath>

#include <ctime>

#include <queue>

#include <stack>

#include <map>

#include <set>



using namespace std;



#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)

#define np(v) next_permutation(v.begin(), v.end())

#define pll pair < long long, long long>

#define all(a) a.begin(), a.end()

#define ull unsigned long long

#define pii pair < int, int >

#define sz(a) (int)a.size()

#define sqr(x) ((x) * (x))

#define y1 stupid_cmath

#define vi vector <int>

#define pb push_back

#define mp make_pair

#define ll long long

#define endl "\n"

#define s second

#define f first





const int inf = (int)1e9;

const int mod = (int)1e9 + 7;

const int N = (int)50505;

const double eps = 1e-9;

const double pi = acos(-1.0);



int n, x;



void solve(){

    cin >> n;

    int cnt = 0;

    for(int i = 1; i <= n; ++i){

        cin >> x;

        if(x & 1) cnt++;

    }

    if(n == 1){

        cout << "YES" << endl;

        return ;

    }

    if(cnt & 1){

        cout << "NO" << endl;

        return;

    }

    cout << "YES" << endl;

}



int main(){

    ios_base::sync_with_stdio(0), cin.tie(0);

    int T;

//    cin >> T;

    T = 1;

    for(int i = 1; i <= T; ++i){

        solve();

    }

}


// Optimized solution to the same problem (faster):
#include<cstdio>



int main(){

    int N,Sum=0;

    scanf("%d",&N);

    for(int i=1;i<=N;i++){

        int x;

        scanf("%d",&x);

        Sum+=x%2;

    }

    if(Sum%2) puts("NO");

    else puts("YES");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <iomanip>

#include <cstdio>

#include <string>

#include <cstring>

#include <deque>

#include <list>

#include <queue>

#include <stack>

#include <vector>

#include <utility>

#include <algorithm>

#include <map>

#include <set>

#include <complex>

#include <cmath>

#include <limits>

#include <cfloat>

#include <climits>

#include <ctime>

#include <cassert>

using namespace std;



#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)

#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)

#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)

#define all(v) begin(v), end(v)

#define pb(a) push_back(a)

#define fr first

#define sc second

#define INF 2000000000

#define int long long int



#define X real()

#define Y imag()

#define EPS (1e-10)

#define EQ(a,b) (abs((a) - (b)) < EPS)

#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )

#define LE(n, m) ((n) < (m) + EPS)

#define LEQ(n, m) ((n) <= (m) + EPS)

#define GE(n, m) ((n) + EPS > (m))

#define GEQ(n, m) ((n) + EPS >= (m))



typedef vector<int> VI;

typedef vector<VI> MAT;

typedef pair<int, int> pii;

typedef long long ll;



typedef complex<double> P;

typedef pair<P, P> L;

typedef pair<P, double> C;



int dy[]={0, 0, 1, -1};

int dx[]={1, -1, 0, 0};

int const MOD = 1000000007;



namespace std {

    bool operator<(const P& a, const P& b) {

        return a.X != b.X ? a.X < b.X : a.Y < b.Y;

    }

}



signed main() {

    int n; cin >> n;

    int a[100010] = {};

    int even = 0, odd = 0;

    rep(i,0,n) {

        cin >> a[i];

        if(a[i] % 2) odd++;

        else even++;

    }



    int e = odd / 2;

    even += e;

    odd -= e * 2;

    if(odd == 0) cout << "YES" << endl;

    else cout << "NO" << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

using namespace std;



int main() {

    int N, cnt = 0; scanf("%d", &N);

    for(int i=0; i<N; i++) {

        int p; scanf("%d", &p);

        cnt += (p % 2);

    }

    printf("%s\n", (cnt % 2) ? "NO" : "YES");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <cmath>

#include <cstring>

#include <numeric>

#include <algorithm>

#include <functional>

#include <array>

#include <map>

#include <queue>

#include <limits.h>

#include <set>

#include <stack>

#include <random>

#include <complex>

#include <unordered_map>

#define rep(i,s,n) for(int i = (s); (n) > i; i++)

#define REP(i,n) rep(i,0,n)

#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))

#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))

#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))

#define PW(x) ((x)*(x))

#define ALL(x) (x).begin(), (x).end()

#define RALL(x) (x).rbegin(), (x).rend()

#define MODU 1000000007

#define bitcheck(a,b)   ((a >> b) & 1)

#define bitset(a,b)      ( a |= (1 << b))

#define bitunset(a,b)    (a &= ~(1 << b))

#define MP(a,b) make_pair((a),(b))

#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))

#define pritnf printf

#define scnaf scanf

#define itn int

#define PI 3.141592653589





#define izryt bool



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

template<typename A, size_t N, typename T>

void Fill(A(&array)[N], const T &val) {

	std::fill((T*) array, (T*) (array + N), val);

}

pii Dir[8] = { //移動

	{ 0 ,1 },{ -1 ,0 },{ 1 ,0 },{ 0 ,-1 },

	{ 1 ,1 },{ 1 ,-1 },{ -1 ,1 },{ -1 ,-1 }

};





signed main() {

	int n;

	int odc = 0;

	scnaf("%d", &n);

	REP(i, n) {

		int a;

		scanf("%d", &a);

		odc += a % 2;

	}

	printf(odc%2 ? "NO\n" : "YES\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#import<cstdio>

int n,a;bool f;main() {scanf("%d",&n);while(n--){scanf("%d",&a);f^=a&1;}puts(f?"NO\n":"YES\n");}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define fol(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(){

    int n;cin>>n;

    int a,b=0,c=0;

    fol(i,n){

        cin>>a;

        a%2?c++:b++;

    }

    if(b>=0&&c%2==0){

        cout << "YES"<<endl;

    }else{

        cout << "NO" << endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#define fol(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(){

    int n;scanf("%d",&n);

    int a,b=0,c=0;

    fol(i,n){

        scanf("%d",&a);

        a%2?c++:b++;

    }

    if(b>=0&&c%2==0){

        printf("YES\n");

    }else{

        printf("NO\n");

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// be name khoda

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define pb push_back

const ll maxn=100009;

vector <ll> adj[maxn];

ll p[maxn]; ll s=0;

int main()

{

	ios_base::sync_with_stdio(false);

	ll n;	cin >> n; 

	for (ll i=0;i<n;i++)

	{

		ll x; cin>>x; s+=x;

	}

	if (s%2==0) cout<<"YES";

	else cout<<"NO";

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

template <typename T> inline void read(T &x)

{

	x=0;int f=1;char c=getchar();

	for(;c>'9'||c<'0';c=getchar())if(c=='-')f=-1;

	for(;c>='0'&&c<='9';c=getchar())x=(x<<1)+(x<<3)+(c^48);

	x*=f;

}

template <typename T> inline void print(T x)

{

	if(x<0) putchar('-'),x=-x;

	if(x>9) print(x/10);

	putchar(x%10+48);

}

long long s1[1010010],x,y,z,sum=0;

int main()

{

	read(x);

	for(register int i=1;i<=x;i++)

	{

		read(s1[i]);

		if(s1[i]%2!=0)

			sum++;

	}

	if(sum%2==0)

		cout<<"YES";

	else

		cout<<"NO";

	return 0;

}

// Fastest known solution for this problem: