#include <bits/stdc++.h>
using namespace std;
set<int> vals;
map<int, int> cnts;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vals.insert(x);
    cnts[x]++;
  }
  vector<int> vals;
  for (auto a : cnts) {
    if ((a.second * 3) % n != 0) {
      cout << "No" << endl;
      return 0;
    }
    for (int i = 0; i < (a.second * 3) / n; i++) {
      vals.push_back(a.first);
    }
  }
  if (vals[0] ^ vals[1] ^ vals[2] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
