#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<P,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
using namespace std;
vector<int> v;
signed main(){
	int n,a,b;
	cin>>n;
	f(i,n){
		cin>>v[i];
	}
	sort(v.begin(),v.end());
	int a=v[0],b=v[upper_bound(v.begin(),v.end(),v[0])-v];
	v.erase(v.begin()+0);
	v.erase(upper_bound(v.begin(),v.end(),v[0]));
	if(binary_search(v.begin(),v.end(),a^b)) c=a^b;
	v.erase(lower_bound(v.begin(),v.end(),a^b));
	f(i,n-3){
		if(i%3==0){
			if(binary_search(v.begin(),v.end(),a))v.erase(lower_bound(v.begin(),v.end(),a));
			else{
				puts("No");
				return 0;
			}
		}
		if(i%3==1){
			if(binary_search(v.begin(),v.end(),b))v.erase(lower_bound(v.begin(),v.end(),b));
			else{
				puts("No");
				return 0;
			}
		}
		if(i%3==2){
			if(binary_search(v.begin(),v.end(),c))v.erase(lower_bound(v.begin(),v.end(),c));
			else{
				puts("No");
				return 0;
			}
		}
	}
	if(n%3)puts("No");
	else puts("Yes");
}
