#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/range/algorithm.hpp>
#define rep(i,n) for (int i=0; i< (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  int n;
  string ans;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<int> zero(n,0);
  if(a==zero) ans = "Yes";
  else if(n%3!=0&&a!=zero) ans = "No";
  else{
    map<int,int> count{};
    rep(i,n){
      count[a[i]]++;
    }
    if (count.size()==3){
      vector<int> num, h;
      for(auto& p: count){
        num.push_back(p.first);
        h.push_back(p.second);
      }
      if((num[0]^num[1]^num[2])==0 && h[0]==h[1] && h[1]==h[2]) ans = "Yes";
      else{ans = "No";}
    }
    else if(count.size()==2){
      vector<int> num, h;
      for(auto& p: count){
        num.push_back(p.first);
        h.push_back(p.second);
      }
      if((num[0]==0&&2*h[0]==h[1])||(num[1]==0&&h[0]==2*h[1])) ans = "Yes";
      else{ans = "No";}
    }
  }

  cout << ans << endl;

  return 0;
}
