#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
	int n; cin >> n;
	vector<int> a(n);
	set<int> val;
	bool flag = true;
	for (int i = 0; i < n; ++i) cin >> a[i];
	sort(a.begin(), a.end());
	int tmp = 1, cnt, hoge = 0;
	while (hoge + 1 < n && a[hoge] == a[hoge + 1]) tmp++, hoge++;
	for (; hoge < n; ++hoge) {
		cnt = 1;
		while (++hoge < n && a[hoge - 1] == a[hoge]) cnt++;
		hoge--;
		if (tmp != cnt) flag = false;
	}
	if (n % 3 || flag) cout << "No" << endl;
	else {
		a.erase(unique(a.begin(), a.end()), a.end());
		flag = true;
		for (int i = 0; i < a.size(); ++i) {
			if ((a[i] ^ a[(i + 2) % a.size()]) != a[(i + 1) % a.size()]) flag = false;
		}
		if (flag) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	
	return 0;
}