#include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define mp make_pair
#define timer ((double)clock() / CLOCKS_PER_SEC)
#define endl "\n"
#define spc " "
#define d1(x) cerr<<#x<<":"<<x<<endl
#define d2(x, y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl
#define d3(x, y, z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl
#define fast_io() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;

typedef long long int lli;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<double, double> dd;

const int N = (int)(1e6 + 5);
const int LOG = (int)(20);

lli n, ar[N];
map<lli, lli> mpx;
vector<lli> v;

int main() {
	fast_io();
	// freopen("inp.in", "r", stdin);
	
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> ar[i];
		mpx[ar[i]]++;
	}
	if(mpx.size() >= 4) {
		cout << "No";
		return 0;
	}
	if(mpx.size() == 1) {
		if(mpx[0] >= 1) {
			cout << "Yes";
			return 0;
		}
		else {
			cout << "No";
			return 0;
		}
	}
	sort(ar + 1, ar + n + 1);
	if(mpx.size() == 2) {
		if(ar[1] == 0 && mpx[0] * 2 == mpx[ar[n]]) {
			cout << "Yes";
			return 0;
		}
		else {
			cout << "No";
			return 0;
		}
	}
	if(n % 3 != 0) {
		cout << "No";
		return 0;
	}
	if(mpx.size() == 3) {
		for(auto i : mpx) {
			if(i.se != n / 3) {
				cout << "No";
				return 0;
			}
			v.pb(i.fi);
		}
		if(v[0] ^ v[1] == v[2]) {
			cout << "Yes";lli
			return 0;
		}
		else {
			cout << "No";
			return 0;
		}
	}
}