#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> cnt;
  int a;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    cnt[a]++;
  }
  if (3 < cnt.size()) {
    cout << "No" << endl;
    return 0;
  }
  vector<pair<int, int>> v;
  for (auto it = cnt.begin(); it != cnt.end(); ++it) {
    v.emplace_back(it->second, it->first);
  }
  sort(v.begin(), v.end());
  if (v.size() == 1) {
    if (v[0].second ^ v[0].second == v[0].second) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (v.size() == 2 && n % 3 == 0) {
    if (v[0].first * 2 == v[1].first &&
        v[1].second ^ v[1].second == v[0].second) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (cnt.size() == 3 && n % 3 == 0) {
    if (v[0].first == v[1].first && v[1].first == v[2].first &&
        v[0].second ^ v[1].second == v[2].second) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
