#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define inf1 1e18+1
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(a>b)swap(a,b);if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n;
	cin>>n;
	int a[n];
	map<int,int>mp;
	int c=0;
	vector<int>u;
	rep(i,n){cin>>a[i];if(mp[a[i]]==0){u.push_back(a[i]);c++;}mp[a[i]]++;}
	//if(n%3){cout<<"No";return;}
	if(u.size()==1&&a[0]){cout<<"No";return;}
  	else if(u.size()==1)cout<<"Yes";return;}
	vector<int>v;
	v.push_back(u[0]);
	v.push_back(u[1]);
	mp[u[0]]--;
	mp[u[1]]--;
	int i=0;
	while(v.size()!=n){
		int x=v[i]^v[i+1];
		if(mp[x]){
			v.push_back(x);
			i++;
			mp[x]--;
		}
		else {cout<<"No";return;}
	}
	//for(int i:v)cout<<i<<" ";cout<<"\n";
	if((v[n-1]^v[n-2])==v[0]&&(v[n-1]^v[0])==v[1])cout<<"Yes";
	else cout<<"No";
}
int main()
{
	waste;
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}