#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <limits>
#include <queue>
#include <map> 
using namespace std;

#define LL long long


int main()
{
	LL N;
	cin >> N;

	LL num;
	map<LL, LL> mp;

	for (LL i = 0; i < N; i++) {
		//cin >> num;
		scanf_s("%lld", &num);
		mp[num]++;
	}

	LL size = mp.size();
	if (size == 1) {
		if (mp[0] == N) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	
	if (N % 3 != 0) {
		cout << "No" << endl;
		return 0;
	}

	if (size == 2) {
		if (mp[0] == (N / 3)) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	else if (size == 3) {
		// first: key, second: value
		auto iter = mp.begin();
		LL key1 = iter->first;
		LL val1 = iter->second;

		iter++;
		LL key2 = iter->first;
		LL val2 = iter->second;

		iter++;
		LL key3 = iter->first;
		LL val3 = iter->second;

		if (val1 == val2 && val2 == val3) {
			if ((key1 ^ key2) == key3) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

	cout << "No" << endl;
}