#include <bits/stdc++.h>
using namespace std;
template <typename H>
bool chmin(H& v1, const H v2) {
  if (v1 > v2) {
    v1 = v2;
    return true;
  }
  return false;
}
template <typename H>
bool chmax(H& v1, const H v2) {
  if (v1 < v2) {
    v1 = v2;
    return true;
  }
  return false;
}
template <typename H>
void read(H& head) {
  cin >> head;
}
template <typename H, typename... T>
void read(H& head, T&... tail) {
  cin >> head;
  read(tail...);
}
template <typename H>
void write(H head) {
  cout << head << '\n';
}
template <typename H, typename... T>
void write(H head, T... tail) {
  cout << head << " ";
  print(tail...);
}
template <typename... T>
void die(T... tok) {
  write(tok...);
  exit(0);
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  if (n % 3 != 0) die("No");
  map<int, int> mp;
  vector<int> v;
  for (int i = 0; i < (n); ++i) {
    int t;
    read(t);
    mp[t]++;
  }
  for (auto p : mp)
    for (int i = 0; i < (p.second / (n / 3)); ++i) v.push_back(p.first);
  if (v.size() != 3) die("No");
  if ((v[0] ^ v[1]) == v[2] && (v[0] ^ v[2]) == v[1] && (v[1] ^ v[2]) == v[0])
    die("Yes");
  else
    die("No");
}
