#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;
const llong inf = 1100100100100100ll;
const llong mod = 1e9 + 7;
int main() {
  llong N;
  vector<llong> a;
  map<llong, llong> m;
  cin >> N;
  a.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (m.size() != 3) {
    cout << "No" << endl;
  } else {
    vector<llong> v;
    map<llong, llong> mm;
    for (auto it = m.begin(); it != m.end(); ++it) {
      v.push_back(it->first);
      mm[it->second]++;
    }
    if ((v[0] ^ v[1]) != v[2] || (v[1] ^ v[2]) != v[0] ||
        (v[2] ^ v[0]) != v[1]) {
      cout << "No" << endl;
    } else if (N % 3 == 0 && mm.size() == 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
