#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
int main(){
	int n;
	cin >>n;
	vector<int> a(n);
	map<int,int> s;
	rep(i,n){
		cin>>a[i];
		s[(a[i])]=0;
	}
	if (n%3!=0){
			cout << "No";
			return 0;
		}
	rep(i,n){
		s[(a[i])]++;
	}
	int tmp = s[(a[0])];
	rep(i,n){
		if (s[(a[i])]!=tmp){
			cout << "No";
			return 0;
		}
	}
	if (s.size()>3){
		cout << "No";
		return 0;
	}
	sort(a.begin(),a.end());
	unique(a.begin(),a.end());
	if (a.size()<3&&a[0]==0){
		cout <<"Yes";
		return;
	}
	int b=a[0],c=a[1],d=a[2];
	if (b^c==d&&c^d==b&&d^b==c)
		cout <<"Yes";
	else
		cout <<"No";
}