#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	map<int,int> kazu;
	vint kind;
	scan(N);
	rep(i,N){
		int a;
		scan(a);
		if(kazu[a]==0){
			kind.push_back(a);
		}
		kazu[a]++;
	}
	sort(kind.begin(),kind.end());
	int flag=0;
	if(kind.size()==1&&kind[0]==0){
		flag=1;
	}
	else if(N%3==0&&kind.size()==2){
		if(kind[0]==0&&kazu[0]==N/3&&kazu[kind[1]]==2*N/3) flag=1;
	}
	else if(N%3==0kind.size()==3){
		if(kazu[kind[0]]==N/3&&kazu[kind[1]]==N/3&&kazu[kind[2]]==N/3&&(kind[0]^kind[1]^kind[2])==0) flag=1;
	}
	if(flag) prin("Yes");
	else prin("No");
	return 0;
}
