stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int N, ai;

int main(){

	scanf("%d", &N);

	

	map <int, int> mp;

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

		scanf("%d", &ai);

		mp[ai]++;

	}

	

	if(N % 3 == 0){

		if(mp.size() == 1){

			if(mp.begin()->first == 0)printf("Yes\n");

			else printf("No\n");

		}else if(mp.size() == 2){

			if(mp.begin()->first == 0 && mp.begin()->second * 2 == next(mp.begin())->second)printf("Yes\n");

			else printf("No\n");

		}else if(mp.size() == 3){

			if((mp.begin()->first ^ next(mp.begin())->first ^ next(next(mp.begin()))->first) != 0)printf("No\n");

			else if(mp.begin()->second != next(mp.begin())->second || next(mp.begin())->second != next(next(mp.begin()))->second)printf("No\n");

			else printf("Yes\n");

		}else printf("No\n");

	}else{

		if((int)mp.size() > 1 || mp.begin()->first != 0)printf("No\n");

		else printf("Yes\n");

	}

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.27798718021437x):
#include<cstdio>

#include<algorithm>

using namespace std;



int a[100001];

int main(){

	int n;

	scanf("%d",&n);

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

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

	int ql=1;

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

		if(a[i])ql=0;

	if(ql){

		printf("Yes\n");

		return 0;

	}

	if(n%3){

		printf("No\n");

		return 0;

	}

	sort(a+1,a+n+1);

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

		if(i!=n/3+1&&i!=n/3*2+1&&a[i]!=a[i-1]){

			printf("No\n");

			return 0;

		}

	if(a[1]^a[n/3+1]^a[n/3*2+1]){

		printf("No\n");

		return 0;

	}

	printf("Yes\n");

}
// Slower C++ solution:
//https://vjudge.net/contest/342760#problem/A

/*

* Author : MaxSally

*/

/********   All Required Header Files ********/

#include<bits/stdc++.h>

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/

#define SCD(t) scanf("%d",&t)

#define SCLD(t) scanf("%ld",&t)

#define SCLLD(t) scanf("%lld",&t)

#define SCC(t) scanf("%c",&t)

#define SCS(t) scanf("%s",t)

#define SCF(t) scanf("%f",&t)

#define SCLF(t) scanf("%lf",&t)

#define mem(a, b) memset(a, (b), sizeof(a))

#define rep(i, j, k) for (int i = j ; i <= k ; ++i)

#define rrep(i, j, k) for (int i = j; i >= k; --i)

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

#define rall(cont) cont.end(), cont.begin()

#define foreach(i, a) for(auto i: a)

#define forEach(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define in(A, B, C) assert( B <= A && A <= C)

#define mp make_pair

#define pb push_back

#define inf (int) (1e9 + 7)

#define epsi 1e-9

#define PI 3.1415926535897932384626433832795

#define mod 1000000007

#define read(type) readInt<type>()

#define io ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define left tuyiuoi

#define right fgjhk

#define ss second

#define ff first

#define debug(a) cout << #a << ": " << a << endl

#define debuga1(a, l, r) rep(i, l, r) cout << a[i] << " "; cout << endl

#define Flag(n) cout << "here " << n << endl

const double pi=acos(-1.0);

typedef pair<int, int> pii;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<vl> vll;

typedef pair<ll, ll> pll;

typedef vector<string> vs;

typedef vector<pii> vii;

typedef vector<pll> vpll;

typedef vector<vi> vvi;

typedef map<int,int> MPII;

typedef set<int> SETI;

typedef multiset<int> MSETI;

typedef long int int32;

typedef unsigned long int uint32;

typedef long long int int64;

typedef unsigned long long int  uint64;



const int N = 100005;

int n, a[N];



int main(){

    io;

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

    cin >> n;

    int totalSum = 0;

    rep(i, 1, n){

        cin >> a[i];

        totalSum ^= a[i];

    }

    cout << (totalSum == 0? "Yes": "No");



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.3528714325592475x):
#include<cstdio>

#include<algorithm>

using namespace std;



int a[100001];

int main(){

	int n;

	scanf("%d",&n);

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

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

	int ql=1;

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

		if(a[i])ql=0;

	if(ql){

		printf("Yes\n");

		return 0;

	}

	if(n%3){

		printf("No\n");

		return 0;

	}

	sort(a+1,a+n+1);

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

		if(i!=n/3+1&&i!=n/3*2+1&&a[i]!=a[i-1]){

			printf("No\n");

			return 0;

		}

	if(a[1]^a[n/3+1]^a[n/3*2+1]){

		printf("No\n");

		return 0;

	}

	printf("Yes\n");

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()



{

    long long int n,sum=0,a;

    cin>>n;

    while(n--)

    {

        cin>>a;

        sum=sum^a;

}

    if(sum==0)

    cout<<"Yes"<<endl;

    else

cout<<"No"<<endl;

    

}

// Faster C++ solution for the same problem (measured speedup: 5.289875909196816x):
#include<cstdio>

#include<algorithm>

using namespace std;



int a[100001];

int main(){

	int n;

	scanf("%d",&n);

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

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

	int ql=1;

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

		if(a[i])ql=0;

	if(ql){

		printf("Yes\n");

		return 0;

	}

	if(n%3){

		printf("No\n");

		return 0;

	}

	sort(a+1,a+n+1);

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

		if(i!=n/3+1&&i!=n/3*2+1&&a[i]!=a[i-1]){

			printf("No\n");

			return 0;

		}

	if(a[1]^a[n/3+1]^a[n/3*2+1]){

		printf("No\n");

		return 0;

	}

	printf("Yes\n");

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.294135708720011x):
#include <iostream>

#include <map>

#define snd second

using namespace std;

int n,tp;

map<int,int> mp;

int main()

{

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

	cin>>n;

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

	{

		cin>>tp;

		mp[tp]++;

	}

	if (mp.size()==1)

	{

		if (mp[0]) {cout<<"Yes\n";}

		else {cout<<"No\n";}

	}

	else if (n%3==0)

	{

		if (mp.size()==3)

		{

			int to = 0,xx = 0;

			for (auto x:mp) {to += (x.snd==n/3);xx^=x.first;}

			if (to==3 && xx==0) {cout<<"Yes\n";}

			else {cout<<"No\n";}

		}

		else if (mp.size()==2)

		{

			if (mp[0]==n/3) {cout<<"Yes\n";}

			else {cout<<"No\n";}

		}

		else {cout<<"No\n";}

	}

	else {cout<<"No\n";}

	return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.477628032652481x):
//#pragma GCC optimize(3, "Ofast", "inline")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e6 + 5;

const double eps = 1e-8;

int n,x;

int main()

{

    scanf("%d", &n);

    int ans = 0;

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

        scanf("%d", &x), ans ^= x;

    if (ans)

        puts("No");

    else

        puts("Yes");

    return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.403722189673458x):
//#include<bits/stdc++.h>

#include<iostream>

#include<cmath>

#include<cstdio>

#include<vector>

#include<set>

#include<map>

#include<stack>

#include<queue>

#include<utility>

#include<algorithm>

#include<cstring>

#include<sstream>

#include <iomanip>



typedef long long ll ;

typedef double db;

typedef unsigned long long ull ;

const double pi = 2*acos(0) ;



#define pf		  	printf

#define sf			  scanf

#define sf(a)		 scanf("%d",&a)

#define sfl(a)		scanf("%lld",&a)

#define sff(a,b)	 scanf("%d %d",&a,&b)

#define sffl(a,b)	scanf("%lld %lld",&a,&b)

#define pb(a)         push_back(a)

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

#define loop1(i,n)          for(int i=1;i<=n;i++)

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

#define gcd(a, b)     __gcd(a, b)

#define lcm(a, b)     ((a)*((b)/gcd(a,b)))

#define sq(a)		   (a)*(a)

#define nw				"\n"

#define abs(x)		fabs(x)

#define pcase(z,x)     cout<<"Case "<<z<<": "<<x<<"\n"

#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)



using namespace std;



int main()

{

	int i,n,x,r=0;

	cin>>n;

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

		cin>>x;

		r = r^x;

		}

	if(r)cout<<"No\n";

	else cout<<"Yes\n";

	return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.4153773946145245x):


#include<bits/stdc++.h>

#pragma GCC optimize ("Ofast")

#define ll long long int

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

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

#define rep1(i,n) FOR(i,1,n)

#define outi(a) printf("%lld\n",(a))

#define prial(a) cout << a << endl;

#define line cout << endl;

#define pb push_back

using namespace std;

inline ll read()

{

    ll x=0; static int p; p=1; static char c; c=getchar();

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

    return x;

}

//****************************

map<int, int>exist;

//****************************

int solve(int i);

int main()

{

  int n = read();

  ll sum =0;

  rep(i,n) sum ^= read();

  if(sum==0) cout << "Yes"<< endl;

  else

  cout<<"No"<<endl;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.408143500777947x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long int n,sum=0,a;

    cin>>n;

    while(n--)

    {

        cin>>a;

            sum=sum^a;

    }

    if(sum==0)

        cout<<"Yes";

    else

        cout<<"No";



}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.412335008087359x):
#include <bits/stdc++.h>

using namespace std;

int n;

#define Maxn 100007

int a[Maxn];

map<int,int> mp;

int main()

{

    scanf("%d",&n);

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

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

    if (n%3==0)

    {

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

            ++mp[a[i]];

        int tmp=0;

        bool check=true;

        for (map<int,int>::iterator it=mp.begin();it!=mp.end();it++)

            if ((*it).second%(n/3)!=0) check=false; 

            else if ((*it).second!=(n/3)*2) tmp^=(*it).first;

        if (check&&tmp==0) printf("Yes\n"); else printf("No\n");

    } else

    {

        bool flag=true;

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

            if (a[i]!=a[1]) flag=false;

        if (flag&&a[1]==0) printf("Yes\n"); else printf("No\n");

    }

    return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#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 FILL(a, b) memset(a, b, sizeof a)

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

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

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



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

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

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

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

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.453390151384087x):
#include<bits/stdc++.h>

using namespace std;

map<int, int> M;

int main()

{

	int N;

	scanf("%d", &N);

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

	{

		int x;

		scanf("%d", &x);

		M[x]++;

	}

	if(M[0] == N)

	{

		puts("Yes");

		return 0;

	}

	if(N%3 != 0)

	{

		puts("No");

		return 0;

	}

	int sum = 0;

	for(map<int, int>::iterator it = M.begin(); it != M.end(); it++)

	{

		//cout << (*it).first << " " << (*it).second << endl;

		if((*it).second % (N/3) != 0)

		{

			puts("No");

			return 0;

		}

		int tmp = (*it).second/(N/3);

		while(tmp--)

			sum ^= (*it).first;

	}

	if(sum == 0)

		puts("Yes");

	else

		puts("No");

	return 0;

}