#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define fi first
#define se second
using ll=long long int;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int main(){
	ll n;
	cin>>n;
	vector<ll>a(n);
	map<int,int>mp;
	rep(i,n){
		cin>>a[i];
		mp[a[i]]++;
	}
	sort(a.begin(),a.end());
	if(mp.size()==1&&mp[0]!=0){//すべて0のパターン
		cout<<"Yes\n";
	}
	else if(mp.size()==2){
		if(mp[0]*2==mp[a[n-1]])cout<<"Yes\n";
		else cout<<"No\n";
	}
	else {
		if(mp.size()==3&&(a[0]^a[n-1]==a[n/3]))cout<<"Yes\n";
		else cout<<"No\n";
	}
	return 0;
}

