#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> ma;
  for (int i; i < N; ++i) {
    int a;
    cin >> a;
    ++ma[a];
  }
  bool ans{};
  int num = ma.size();
  if (num == 3) {
    vector<int> v, n;
    for (const auto &p : ma) {
      v.push_back(p.first);
      n.push_back(p.second);
    }
    if (n[0] == n[1] && n[1] && n[2] && v[0] ^ v[1] == v[2] &&
        v[1] ^ v[2] == v[0] && v[2] ^ v[0] == v[1]) {
      ans = true;
    }
  } else if (num == 1) {
    vector<int> v, n;
    for (const auto &p : ma) {
      v.push_back(p.first);
      n.push_back(p.second);
    }
    if (n[0] % 3 == 0 && v[0] ^ v[0] == v[0]) {
      ans = true;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
