#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
typedef long double ld;
typedef unsigned long long ull;
#define X first
#define Y second
#define mp make_pair
template<class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T, class X> using indexed_map = tree<T, X, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const long long M = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
 
long long modpow(long long n, long long k, long long MOD);
 
/**************** code starts here ****************/

void poppingfever() {
	int n; cin >> n;
	vector<int> a(n);
	map<int, int> mp;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		mp[a[i]]++;
	}

	if (mp.size() > 3) {
		cout << "No"; return;
	}
	if (mp.size() == 1) {
		cout << "Yes"; return;
	}
	
	sort(a.begin(), a.end());
	if (n % 3) {
		cout << "No"; return;
	}
	for (int i = 1; i < n/3; i++) {
		if (a[i] != a[i-1]) {
			cout << "No"; return;
		}
	}
	for (int i = n/3 + 1; i < 2*n/3; i++) {
		if (a[i] != a[i-1]) {
			cout << "No"; return;
		}
	}
	for (int i = 2*n/3 + 1; i < n; i++) {
		if (a[i] != a[i-1]) {
			cout << "No"; return;
		}
	}

	if ((a[0] ^ a[n/3]) == a[2*n/3]) {
		//cout << a[2*n/3];
		cout << "Yes"; return;
	}
	if ((a[0] ^ a[2*n/3]) == a[n/3]) {
		//cout << a[n/3];
		cout << "Yes"; return;
	}
	if ((a[2*n/3] ^ a[n/3]) == a[0]) {
		//cout << a[0];
		cout << "Yes"; return;
	}
	cout << "No";
}
	
/**************************************************/
 
signed main() {
	#ifdef fastfurioustransform
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	#endif
 
	ios::sync_with_stdio(0); cin.tie(0);
	//cout << fixed << setprecision(12);
 
	poppingfever();
 
	return 0;
}
 
long long modpow(long long n, long long k, long long MOD) {
	long long ans = 1; n %= MOD;
	while (k > 0) {
		if (k & 1) ans = (ans*n) % MOD;
		k >>= 1; n = (n*n) % MOD;
	}
	return ans; 
}