#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> freq;
  long long tmp;
  for (long long i = 0; i < (n); i++) cin >> tmp, freq[tmp]++;
  if (n % 3 != 0) return cout << "No", 0;
  if (freq.size() > 3) return cout << "No", 0;
  vector<pair<long long, long long>> f;
  for (auto &p : freq) f.push_back({p.second, p.first});
  sort(f.begin(), f.end());
  long long x = f.size();
  if (x == 1)
    f = vector<pair<long long, long long>>(
        3, make_pair(f[0].first, f[0].second / 3));
  if (x == 2) {
    if (f[1].first != f[0].first * 2) return cout << "No", 0;
    f = {f[0], {f[1].first, f[1].second / 2}, {f[1].first, f[1].second / 2}};
  }
  cout << ((f[0].second ^ f[1].second) == f[2].second ? "Yes" : "No");
  return 0;
}
