#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
LL a[100001];
LL b[100001];
LL c[100001];
LL ch[100001];
int main(){
	cin>>N;

	map<LL,int>m;
	
	REP(i,N){
		cin>>a[i];
		m[a[i]]++;
	}
	int cc=0;
	for(auto it:m){
		b[cc]=it.first;
		c[cc]=it.second;
		cc++;
	}
	if(c>4){
		cout<<"No"<<endl;
	}else{
		REP(i,cc){
			REP(j,cc){
				REP(k,cc){
					ch[k]=c[k];
				}
				LL now=b[i];
				LL now2=b[j];
				ch[i]--;
				ch[j]--;
				REP(k,N-2){
					LL nxt=now^now2;
					ch[nxt]--;
					now=now2;
					now2=nxt;
				}
				bool c=false;
				REP(k,cc){
					if(ch[k]!=0)c=true;
				}
				if(c==false){
					cout<<"Yes"<<endl;
					return 0;
				}
			}
		}
		cout<<"No"<<endl;
	}
	return 0;
}