#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef unsigned long ulong;
#include <algorithm>
#include <functional>
#include <iostream>

int main()
{
	ulong n;
	cin >> n;
	n -= 1;
	vector<ulong> a(n, 0);
	ulong top;
	cin >> top;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	ulong* p = a.data();
	do {
		if ((top ^ p[1]) != p[0]) {
			goto A;
		}
		if ((top ^ p[n - 2]) != p[n - 1]) {
			goto A;
		}
		if ((p[0] ^ p[n - 1]) != top) {
			goto A;
		}
		for (int i = 0; i < n - 2; i++) {
			if ((p[i] ^ p[i + 2]) != p[i + 1]) {
				goto A;
			}
		}
		cout << "Yes";
		return 0;
		A:
	} while (std::next_permutation(p, p + n));
	cout << "No";
}
