#include <bits/stdc++.h>
int main() {
  using namespace std;
  size_t N;
  cin >> N;
  unordered_map<unsigned long, size_t> mp;
  for (unsigned long i = 0, a; i < N; ++i) {
    cin >> a;
    ++mp[a];
  }
  if (mp.size() > 3) return 0 & puts("No");
  if (mp.size() == 1) return 0 & puts(mp[0] == N ? "Yes" : "No");
  if (mp.size() == 2) {
    assert(0);
    return 0 & puts(mp[0] * 3 == N ? "Yes" : "No");
  }
  if (mp.size() == 3) {
    vector<unsigned long> a;
    for (const auto& i : mp) {
      if (i.second * 3 != N) return 0 & puts("No");
      a.push_back(i.first);
    }
    puts(a[0] ^ a[1] == a[2] ? "Yes" : "No");
  }
  return 0;
}
