#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
#include<map>
#include<set>
using namespace std;
#define INF 11000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll> P;

int main(){
  int N,count[3];
  ll temp;
  cin>>N;
  set<ll> S;
  map<ll,int> M;
  for(int i=0;i<N;i++){
    cin>>temp;
    S.insert(temp);
    if(M.find(temp)==M.end()) M[temp]=0;
    M[temp]++;
  }
  if(S.size()==1 && temp==0) cout<<"No"<<endl;
  else if(M.find(0)!=M.end() && M[0]==N/3*2 && N%3==0) cout<<"Yes"<<endl;
  else if(S.size()!=3) cout<<"No"<<endl;
  else{
    set<ll>::iterator it=S.begin();
    int i=0;
    for(;mt!=M.end();mt++){
      count[i]=mt->second;
      i++;
    }
    ll a=*it; it++;
    ll b=*it; it++;
    ll c=*it;
    if(a^b^c==0 && N%3==0 && count[0]==N/3 && count[1]==N/3 && count[2]==N/3) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }

}
