#include <bits/stdc++.h>
using namespace std;
int main() {
  uint32_t n;
  cin >> n;
  vector<uint32_t> an(n);
  for (uint32_t& a : an) {
    cin >> a;
  }
  sort(an.begin(), an.end());
  vector<uint32_t> unique;
  unique_copy(an.begin(), an.end(), back_inserter(unique));
  bool exists = true;
  if (exists) {
    if (unique.size() != 3) {
      exists = false;
    }
  }
  if (exists) {
    if ((unique[0] ^ unique[1]) != unique[2]) {
      exists = false;
    }
  }
  if (exists) {
    for (int i = 0; i < 3; i++) {
      size_t count =
          count_if(an.begin(), an.end(),
                   [unique, i](uint32_t a) -> bool { return a == unique[i]; });
      if (count != (size_t)n / 3) {
        exists = false;
        break;
      }
    }
  }
  string result = exists ? "Yes" : "No";
  cout << result << endl;
  return 0;
}
