#include<bits/stdc++.h>
#define xx first
#define yy second
#define ll long long
using namespace std;

const int N = 200000 + 5;
int info[N], cnt[N], n, val[N], tot;

int main () {
	#ifdef wll
//	freopen ("testdata.in", "r", stdin);
	#endif
	scanf ("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf ("%d", &info[i]);
	}
	if (n <= 3) {
		if (info[1] ^ info[2] == info[3] || info[1] ^ info[3] == info[2] || info[2] ^ info[3] == info[1]) {
			printf ("Yes\n");
		}
		else {
			printf ("No\n");
		}
		return 0;
	}
	sort (info + 1, info + n + 1);
	val[1] = info[1];
	cnt[1] = 1;
	tot = 1;
	for (int i = 2; i <= n; ++i) {
		if (info[i] != info[i - 1]) {
			tot++;
			cnt[tot] = 1;
			val[tot] = info[i];
		}
		else {
			cnt[tot]++;
		}
	}
	if (tot > 3) {
		printf ("No\n");
		return 0;
	}
	if (info[1] ^ info[2] == info[3] || info[1] ^ info[3] == info[2] || info[2] ^ info[3] == info[1]) {
		int tmp;
	}
	else {
		printf ("No\n");
		return 0;
	}
	sort (cnt + 1, cnt + 4);
	if (n % 3 == 0) {
		if (cnt[1] == cnt[2] && cnt[2] == cnt[3]) {
			printf ("Yes\n");
		}
		else {
			printf ("No\n");
		}
	}
	else {
		if (tot == 1 && val[1] == 0) {
			printf ("Yes\n");
		}
		else {
			printf ("No\n");
		}
	}
	/*else if (n % 3 == 1) {
		if (cnt[1] == cnt[2] && cnt[2] == cnt[3] - 1) {
			printf ("Yes\n");
		}
		else {
			printf ("No\n");
		}
	}
	else {
		if (cnt[1] == cnt[2] - 1 && cnt[2] == cnt[3]) {
			printf ("Yes\n");
		}
		else {
			printf ("No\n");
		}
	}*/
	return 0;
}




















