#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define REPR(i,n) for(int i=n-1; i>=(int)(0); i--)
#define FOR(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define FORR(i,a,b) for(int i=(int)(b)-1; i>=(int)(a); i--)
#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()
//**関数リスト**//
int ctoi(char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.second < secondElof.second;
}
ll nod(ll F) {
	ll keta = 1;
	while (F / 10 > 0) {
		keta++;
		F /= 10;
	}
	return keta;
}
ll gcd(ll x, ll y) {
	ll r;
	if (x < y) {
		swap(x, y);
	}
	while (y > 0) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}
ll lcm(ll x, ll y) {
	return x * y / gcd(x, y);
}
ll isPrime(ll x) {
	ll i;
	if (x < 2) {
		return 0;
	}
	else if (x == 2) {
		return 1;
	}
	else if (x % 2 == 0) {
		return 0;
	}
	else {
		for (i = 3; i * i <= x; i += 2) {
			if (x % 1 == 0) {
				return 0;
			}
		}
		return 1;
	}
}
void eratos(vl isPrime) {
	//(注)isPrimeのサイズはN+1にする！実際にはmain内に配置して使用
	ll i, j;
	REP(i, isPrime.size()) {
		isPrime[i] = 1;
	}
	isPrime[0] = 0; isPrime[1] = 0;
	for (i = 2; i * i <= isPrime.size() - 1; i++) {
		if (isPrime[i] == 1) {
			j = i * 2;
			while (j <= isPrime.size() - 1) {
				isPrime[j] = 0;
				j = j + i;
			}
		}
	}
}
ll modinv(ll a, ll m) {
	ll b = m, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
void bitSearch(ll n) {
	//実際にはコピーして中身を改変して使う
	ll i;
	REP(i, pow(2, n)) {
		ll p = i;
		REP(i, n) {
			cout << p % 2;
			p /= 2;
		}
		cout << endl;
	}
}
void dfs(ll now) {
	//中身は毎回書き換えて使用
	stack <ll> S;
	//flagは初期値0
	S.push(now);
	//flag[now]=1;
	while (!S.empty()) {
		ll u = S.top();
		//ll v = ;
		//if(flag[v]==0){flag[v]=1;S.push[v];}else{S.pop();}
	}
}
void bfs(ll now) {
	//中身は毎回書き換えて使用
	queue<ll> Q;
	Q.push(now);
	ll u;
	while (!Q.empty()) {
		u = Q.front();
		Q.pop();
		//ll v=;
		//Q.push(v);
	}
}
//**定義場所**//
ll i, j, k, l, m, n;
ll N, M, K, H, W;
ll MOD = 1000000007;
ll ans = 0;
//***********//
int main() {
	cin >> N;
	vl A(N);
	ll zero=0;
	pll typeA = make_pair(0, 0);
	pll typeB = make_pair(0, 0);
	pll typeC = make_pair(0, 0);
	for (i = 0; i < N; i++) {
		cin >> A[i];
		if (A[i] == 0) {
			zero++;
		}
		else if (typeA.first == 0) {
			typeA.first = A[i];
			typeA.second++;
		}
		else if (A[i] != typeA.first && typeB.first == 0) {
			typeB.first = A[i];
			typeB.second++;
		}
		else if (A[i] != typeA.first && A[i] != typeB.first && typeC.first == 0) {
			typeC.first = A[i];
			typeC.second++;
		}
		else if (A[i] == typeA.first) {
			typeA.second++;
		}
		else if (A[i] == typeB.first) {
			typeB.second++;
		}
		else if (A[i] == typeC.first) {
			typeC.second++;
		}
	}
	if (zero == N) {
		cout << "Yes";
	}
	else if (N % 3 != 0) {
		cout << "No";
	}
	else if (typeA.second == N * 2 / 3 && zero == N / 3) {
		cout << "Yes";
	}
	else if (typeA.second == N / 3 && typeB.second == N / 3 && typeC.second == N / 3 && ((typeA.first ^ typeB.first) ^ typeC.first) == 0) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}


Measured memory_bytes: 1024