#include <iostream>
#include <algorithm>
using namespace std;

long long N, A[1 << 18], S;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) { cin >> A[i]; S += A[i]; }
	
	if (S == 0) {
		cout << "Yes" << endl;
		return 0;
	}
	if (N % 3 != 0) {
		cout << "No" << endl;
		return 0;
	}

	for (int t = 0; t < 3; t++) {
		for (int i = 0; i < (N / 3) - 1; i++) {
			int v = t * (N / 3) + i;
			if (A[v] != A[v + 1]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	int w[3] = { A[0], A[N / 3], A[2 * N / 3] };
	sort(w, w + 3);

	do {
		if (w[0] == (w[1] ^ w[2]) && w[1] == (w[2] ^ w[0]) && w[2] == (w[0] ^ w[1])) {
			cout << "Yes" << endl;
			return 0;
		}
	} while (next_permutation(w, w + 3));

	cout << "No" << endl;
	return 0;
}