#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mpa;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    mpa[a]++;
  }
  if (mpa.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<pair<int, int> > va;
  map<int, int>::iterator itr;
  for (itr = mpa.begin(); itr != mpa.end(); itr++) {
    va.push_back(make_pair(itr->first, itr->second));
  }
  if ((va[0].first ^ va[1].first) != va[2].first) {
    cout << "No" << endl;
    return 0;
  }
  if (va[0].second != va[1].second || va[1].second != va[2].second ||
      va[2].second != va[0].second) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
