#include<bits/stdc++.h>
using namespace std;
const int maxn=1e9;
int n,a[100002],bin[maxn],ma=-1;
int main(void){
	cin>>n;
	memset(bin, 0, sizeof(bin));
	for(int i=0;i<n;i++){
		cin>>a[i];
		bin[a[i]]++;
		ma=max(ma,bin[a[i]]);
	}
	if(bin[0]!=0)
		if(ma<bin[0]*2){
			cout<<"No";
			return 0;
		}
	sort(a,a+n);
	a[n]=a[0];
	a[n+1]=a[1];
	for(int i=1;i<=n;i++){
		if(a[i-1]!=(a[i]^a[i+1])){
			goto lo;
		}
	} 
	cout<<"Yes";
	return 0;
	lo:reverse(a,a+n);
	for(int i=1;i<=n;i++){
		if(a[i-1]!=(a[i]^a[i+1])){
			cout<<"No";
			return 0;
		}
	} 
	cout<<"Yes";
	return 0;
}
