#include <bits/stdc++.h>
using namespace std;
int main() {
  uint64_t N;
  cin >> N;
  set<uint64_t> Aset;
  multiset<uint64_t> Amset;
  for (uint64_t n = 0; n < N; ++n) {
    uint64_t A;
    cin >> A;
    Aset.insert(A);
    Amset.insert(A);
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (Aset.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  uint64_t A1 = *Aset.begin();
  Aset.erase(Aset.begin());
  uint64_t A2 = *Aset.begin();
  Aset.erase(Aset.begin());
  uint64_t A3 = *Aset.begin();
  Aset.erase(Aset.begin());
  uint64_t C1 = Amset.count(A1);
  uint64_t C2 = Amset.count(A2);
  if ((C1 != (N / 3)) || (C2 != (N / 3))) {
    cout << "No" << endl;
    return 0;
  }
  cout << (((A1 ^ A2) == A3) ? "Yes" : "No") << endl;
  return 0;
}
