#include <bits/stdc++.h>
using namespace std;
int N, a;
map<int, int> mp;
bool tourist() {
  if (mp.size() >= 4) return false;
  if (mp.size() == 3) {
    vector<pair<int, int>> v;
    for (pair<int, int> p : mp) {
      v.push_back(p);
    }
    if ((v[0].first ^ v[1].first) == v[2].first && v[0].second == v[1].second &&
        v[1].second == v[2].second) {
      return true;
    } else {
      return false;
    }
  }
  if (mp.size() == 2) {
    pair<int, int> p = *mp.begin();
    if (p == make_pair(0, N / 2) && N % 2 == 0) {
      return true;
    } else {
      return false;
    }
  }
  if (mp.size() == 1) return true;
  return false;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    ++mp[a];
  }
  if (tourist()) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
