//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
map<int,int> app;
int differ;
int flag=1;
int flag2=0;
int main(){
	int n;
	int ai;
	cin>>n;
	rb(i,1,n){
		cin>>ai;
		if(ai==0) flag2=1;
		if(ai) flag=0;
		if(app[ai]==0){
			app[ai]=1;
			differ++;
		}
		else{
			app[ai]++;
		}
	}
	if(flag){
		cout<<"Yes";
		return 0;
	}
	map<int,int> :: IT ite;
	ite=app.begin(); 
	if(differ==3&&!flag2){
		mp a,b,c;
		a=II(ite->FIR,ite->SEC);
		ite++;
		b=II(ite->FIR,ite->SEC);
		ite++;
		c=II(ite->FIR,ite->SEC);
		int resflag=0;
		if(a.FIR^b.FIR==c.FIR){
			swap(b,c);
			resflag=1;
		}
		if(a.FIR^c.FIR==b.FIR){
			resflag=1;
		}
		if(b.FIR^c.FIR==a.FIR){
			swap(b,a);
			resflag=1;
		}
		if(resflag)
		if(a.SEC==c.SEC&&b.SEC==a.SEC)){
			cout<<"Yes";
			return 0;
		}
	}
	if(differ==2&&flag2){
		mp a,zer;
		zer=II(ite->FIR,ite->SEC);
		ite++;
		a=II(ite->FIR,ite->SEC);
		if(a.SEC==zer.SEC-1){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}