#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  bool b=true;
  int a[100000];
  rep(i,n){
    cin>>a[i];
    if(a[i]!=0) b=false;
  }
  if(b){cout<<"Yes"<<endl;return 0;}
  else{
    if(n%3!=0){cout<<"No"<<endl;return 0;}
    sort(a,a+n);
    vector<pair<int,int> > num;
    num.push_back(make_pair(a[0],(int)1));
    int p=0;
    repi(i,1,n){
      if(num[p].first==a[i]){
	num[p].second++;
      }else{
	num.push_back(make_pair(a[i],(int)1));
	p++;
      }
    }
    if(num.size() > 3){cout<<"No"<<endl;}
    else{
      if(num.size() ==3){
	if(num[0].scd==num[1].scd && num[1].scd==num[2].scd){
	  int xo=num[0].fst^num[1].fst;
	  xo^=num[2].fst;
	  if(xo==0){cout<<"Yes"<<endl;}
	  else cout<<"No"<<endl;
	}
	else cout<<"No"<<endl;
      }
      else if(num.size()==2){
	if(num[0].scd==num[1].scd*2 && num[1].fst==0){cout<<"Yes"<<endl;}
	else if(num[1].scd==num[0].scd*2 && num[0].fst==0){cout<<"Yes"<<endl;}
	else cout<<"No"<<endl;
      }
      else cout<<"No"<<endl;
    }
  }
    
