#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <numeric>
#include <stack>
#include <map> // pair
#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()
typedef std::stack<int> IntStack;
typedef std::stack<char> charStack;
#define START 0
#define FORWARD 1
#define BACK 2
using namespace std;
using ll = long long;
typedef pair <ll, ll > pll;
bool comp(const pll &a, const pll &b) {
	return a.first < b.first;
}
//*********************************************************
// 最大公約数（Greatest Common Divisor）を返す。
// 引数に０がある場合は０を返す。
//*********************************************************
ll gcd(ll a, ll b)
{
	ll tmp, r;
	if (a < b) {
		tmp = a;
		a = b;
		b = tmp;
	}

	/* ユークリッドの互除法 */
	r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
	//// 引数に０がある場合は０を返す
	//if ((0 == m) || (0 == n))
	//	return 0;

	//// ユークリッドの方法
	//while (m != n)
	//{
	//	if (m > n) m = m - n;
	//	else         n = n - m;
	//}
	//return m;
}//gcd
int factorial(int k);//階乗
ll nCr(ll n, ll r);//コンビネーション
int permutation(int n, int r);//nPk パーミュテーション

int main()
{
	ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	ll x[200004] = {};
	ll y[200004] = {};
	ll z[2003][2003] = { {} };
	vector<tuple<ll, ll>> vec;
	string s;
	string t;
	//IntStack yStack;
	//charStack Stack;
	//vector<pair<int, int> > pairs(a);
	//cout << LLONG_MAX<< endl;
	

	cin >> a;
	for (ll i = 0; i < a; i++)
	{
		cin >> x[i];
	}
	if (a % 3 != 0)
	{
		for (ll i = 0; i < a; i++)
		{
			if (x[i] != 0)
			{
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;

	}
	else
	{
		sort(x, x + a);

		for (ll i = 0; i < a; i++)
		{
			if (x[i] != 0)
			{
				ans = 1;
			}
		}
		if (ans == 0)
		{
			cout << "Yes" << endl;
			return 0;
		}

		b = x[0];
		/*for (ll i = 0; i < a; i++)
		{
			cout << x[i] << endl;
		}*/
		c = 0;
		for (ll i = 0; i < a; i++)
		{
			if (b != x[i])
			{
				if (!(c == a / 3 || c == a * 2 / 3))
				{
					/*cout << "aaa" << endl;
					cout << b << endl;
					cout << x[i] << endl;
					cout << c << endl;*/
					cout << "No" << endl;
					return 0;
				}
				b = x[i];
				c = 1;
				d++;
			}
			else
			{
				c++;
			}
		}
		if (!(d == 1 || d == 2))
		{

			cout << "No" << endl;
			return 0;
		}
		if (a >= 6)
		{
			for (ll i = 0; i < a / 3-1; i++)
			{
				if (x[i] != x[i + 1])
				{
					cout << "No" << endl;
				}
			}
			for (ll i = a/3; i < a*2 / 3-1; i++)
			{
				if (x[i] != x[i + 1])
				{
					cout << "No" << endl;
				}
			}
			for (ll i = a*2/3; i < a-1; i++)
			{
				if (x[i] != x[i + 1])
				{
					cout << "No" << endl;
				}
			}
		}


		if ( (x[a / 3] ^ x[0]) == x[a - 1] &&  (x[a - 1] ^ x[a / 3]) == x[0] &&  (x[a - 1] ^ x[0]) == x[a / 3])
		{
			cout << "Yes" << endl;
		/*	cout << (x[a / 3] ^ x[0]) << endl;
			cout << (x[a-1] ^ x[0]) << endl;
			cout << (x[a / 3] ^ x[a-1]) << endl;*/
		}
		else
		{
			cout << "No" << endl;
		}
	}
	/*cout << x[0] << endl;
	cout << x[a/3] << endl;
	cout << x[a-1] << endl;*/

	//{
	//	if (x[0] ^ x[2] == x[1] && x[2] ^ x[1] == x[0] && x[0] ^ x[1] == x[2] )
	//	{
	//		cout << "Yes" << endl;


	//	}
	//	else
	//	{
	//		cout << "No" << endl;

	//	}
	//}


	////std::cout << std::fixed;
	//cout << std::setprecision(20) << << endl;
	//cout << d+1 << endl;
	//cout << "" << endl;

	return 0;
}
//sort(x, x + a, std::greater<ll>());

//char型の文字数字は、-'0'で数値に変換できる
//accumulate(x, x + a, 0);//int型までの配列の合計
//memcpy(x, visited, sizeof(ll)*n);
//void kansuu(ll num, ll visited[10]) {}
//kansuu(1, zz);
//cout << setprecision(15) << v << endl;
//cout << char(z - 'a');
//log10(i) + 1 //10進数の桁数を取得
//
//int temp;
//for (int i = 0; i < n - 1; i++) {
//	for (int j = n - 1; j > i; j--) {
//		if (w[j - 1] < w[j]) {  /* 前の要素の方が大きかったら */
//			temp = w[j];        /* 交換する */
//			w[j] = w[j - 1];
//			w[j - 1] = temp;
//		}
//	}
//}
//
//最小公倍数
//ll x = a * b;
//ll tmp;
///* 自然数 a > b を確認・入替 */
//if (a<b) {
//	tmp = a;
//	a = b;
//	b = tmp;
//}
///* ユークリッドの互除法 */
//ll r = a % b;
//while (r != 0) {
//	a = b;
//	b = r;
//	r = a % b;
//}
//a = x / b;//答え


/*vector<pair<ll, ll> > hoges(a);
for (int i = 0; i < a; i++)
{
cin >> x[i];
cin >> y[i];
hoges[i] = make_pair(x[i], y[i]);
}
sort(hoges.begin(),hoges.end(),comp);
for (int i = 0; i < a; i++)
{
if (hoges[i].second>=b)
{
ans += hoges[i].first*b;
break;
}
else
{
ans += hoges[i].first*hoges[i].second;
b -= hoges[i].second;

}
}*/

int permutation(int n, int r) {
	int n_sum, r_sum;
	int i;
	r = n - r;
	n_sum = factorial(n);
	r_sum = factorial(r);
	return n_sum / r_sum;
}

ll nCr(ll n, ll r) {
	ll ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans*i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
int factorial(int k) {
	int sum = 1;
	for (int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}



Measured memory_bytes: 1792