#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  long long N;
  cin >> N;
  unordered_map<long long, long long> mp;
  for (int i = 0; i < N; ++i) {
    int e;
    cin >> e;
    mp[e]++;
  }
  if (mp.size() > 3) {
    cout << "No\n";
    return 0;
  }
  bool ff = true;
  long long x = mp.begin()->second;
  for (auto&& e : mp) {
    if (e.second != x) ff = false;
  }
  if (ff == false) {
    cout << "No\n";
    return 0;
  }
  auto p = mp.begin();
  x = p->first;
  p++;
  long long y = p->first;
  p++;
  long long z = p->first;
  if (x ^ y == z) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
