#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[i]++;
    }
    if (count.size()!=3){ans = "No"; goto OUT;}
    vector<int> num, h;
    for(auto& p: count){
      int a,b;
      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";}

  }
  OUT:
  cout << ans << endl;

  return 0;
}
