#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define inf 1000000000
#define md 1000000007
#define pb push_back
#define li 100005
#define int long long
using namespace std;
int n,A[li],say,flag;
map<int,int> tp;
vector<int> v;
main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld",&A[i]);
		if(tp[A[i]]==0){
			tp[A[i]]=1;
			v.pb(A[i]);
			say++;
		}
		if(A[i]!=0) flag=1;
	}
	if(say==1){
		if(flag==1){
			printf("No\n");
			return 0;
		}
		printf("Yes\n");
		return 0;
	}
	if(say==2){
		int tut1=v[0];
		int tut2=v[1];
		int xx=tut1^tut2;
		if(xx!=tut1 && xx!=tut2){
			printf("No\n");
			return 0;
		}
		printf("Yes\n");
		return 0;
	}
	if(say==3){
		int tut=v[0];
		int tut2=v[1];
		int tut3=v[2];
		int gg=0;
		if((tut^tut2)==tut3) gg=1;
		if((tut^tut3)==tut2) gg=1;
		if((tut2^tut3)==tut) gg=1;
		if(gg==1) printf("Yes\n");
		else printf("No\n");
		return 0;
	}
	printf("No\n");
	return 0;
}


