#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<ll> a(N);
  for (int((i)) = (0); ((i)) < ((N)); ((i))++) cin >> a[i];
  map<ll, ll> cnt;
  for (auto num : a) cnt[num]++;
  bool res = false;
  vector<pair<ll, ll>> v;
  for (auto itr : cnt) v.push_back({itr.second, itr.first});
  sort(v.begin(), v.end());
  if (cnt.size() == 1) {
    if (v[0].second == 0) {
      res = true;
    }
  }
  if (cnt.size() == 2) {
    if (v[0].first * 2 == v[1].first &&
        v[1].second ^ v[1].second == v[0].second) {
      res = true;
    }
  }
  if (cnt.size() == 3) {
    if (v[0].first == v[1].first && v[0].first == v[2].first &&
        (v[0].second ^ v[1].second == v[2].second)) {
      res = true;
    }
  }
  cout << (res ? "Yes" : "No") << endl;
  return 0;
}
