#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
#include<deque>
#include<iomanip>
using namespace std;
typedef pair<ll, ll>P;
typedef pair<int, pair < int, int > > PP;
typedef long long ll;
ll inf = -1;
ll mod = pow(10, 9) + 7;
int main() {
	int n;cin>>n;
	vector<ll> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a.begin(),a.end());
	vector<P>cnt;
	ll c=1;
	for(int i=1;i<n;i++){
		if(a[i-1]==a[i]){
			c++;
		}else{
			cnt.push_back(P(a[i-1],c));
			c=1;
		}
		if(i==n-1){
			cnt.push_back(P(a[i],c));
		}
	}
	if(cnt.size()==3&&(cnt[0].second==cnt[1].second)
	==cnt[2].second){
		if((cnt[0].first^cnt[1].first)==cnt[2].first){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
		cout<<"No"	<<endl;
	
	return 0;
}