#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n); std::vector<int> a(n);
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	sort(begin(a), end(a));
	
	std::vector<int> latte = a;
	latte.erase(unique(begin(latte), end(latte)), end(latte));
	if(latte.size() > 3) {
		printf("No\n");
		return 0;
	}
	
	bool ans = true;
	if(latte.size() == 1) {
		if(latte[0] != 0) ans = false;
	} else if(latte.size() == 2) {
		ans = false;
	} else if(latte.size() == 3) {
		std::vector<int> vec(3, 0);
		for(auto v: a) for(int i = 0; i < 3; i++) if(latte[i] == v) vec[i]++;
	
		bool flag = false;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 3; k++) {
					if(i == j or j == k or k == i) continue;
					
					bool f = true;
					std::vector<int> malta = vec;
					std::vector<int> tmp;
					for(int l = 0; l < n; l++) {
						int p = 0;
						if(l % 3 == 0) p = i;
						if(l % 3 == 1) p = j;
						if(l % 3 == 2) p = k;
						
						malta[p]--;
						tmp.push_back(latte[p]);
						
						if(malta[p] < 0) f = false;
					}
					for(int l = 0; l < n; l++) {
						int A = (l - 1 + n) % n, B = (l + 1) % n;
						f &= ((tmp[A] ^ tmp[B]) == tmp[l]);
					}
					
					flag |= f;
				}
			}
		}
		if(!flag) ans = false;
	}
	
	if(ans) printf("Yes\n");
	else printf("No\n");
	return 0;
}
