#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)

int main() {
  int n;cin>>n;
  map<int,int> mp;
  for(int i=0;i<n;++i){
    int a;cin>>a;
    if(mp.find(a)!= mp.end()){
      mp[a] +=1;
    } else {
      mp[a] =1;
    }
  }
  if(mp.size()==1){
    if(mp.begin()->first==0){
      cout << "Yes" << endl;
      return 0;
    }
  } else if(n%3==0 && mp.size()==2){
    if(v[0]==0&&mp[v[0]]==n/3){
        cout << "Yes" << endl;
        return 0;
    }
  } else if(n%3==0 && mp.size()==3) {
    vector<int> v,cnt;
    for(auto itr = mp.begin();++i){
      v.push_back(itr->first);
      cnt.push_back(itr->second);
    }
    if(v[0]^v[1]^v[1]&&c[0]==n/3&&c[1]==n/3&&c[2]==n/3){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No"<< endl;
  return 0;
}
