#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
  if (ib == ie) {
    ib = ibuf;
    ie = ibuf + fread(ibuf, 1, BUFF, stdin);
  }
  return ib == ie ? -1 : *ib++;
}
}  // namespace _buff
LL read() {
  using namespace _buff;
  LL ret = 0;
  bool pos = true;
  char c = getc();
  for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
    assert(~c);
  }
  if (c == '-') {
    pos = false;
    c = getc();
  }
  for (; c >= '0' && c <= '9'; c = getc()) {
    ret = (ret << 3) + (ret << 1) + (c ^ 48);
  }
  return pos ? ret : -ret;
}
map<int, int> mp;
int main() {
  int n = read();
  for (int i = 0; i < n; ++i) {
    ++mp[read()];
  }
  bool flag = false;
  if (mp.size() <= 3) {
    set<int> s;
    for (auto &pr : mp) {
      s.emplace(pr.first);
    }
    for (int a : s) {
      for (int b : s) {
        set<int> t;
        t.emplace(a);
        t.emplace(b);
        t.emplace(a ^ b);
        if (s != t) continue;
        map<int, int> np;
        np[a] += n / 3;
        np[b] += n / 3;
        np[a ^ b] += n / 3;
        flag |= mp == np;
      }
    }
  }
  puts(flag ? "Yes" : "No");
  return 0;
}
