#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int out = 0, fh = 1;
  char jp = getchar();
  while ((jp > '9' || jp < '0') && jp != '-') jp = getchar();
  if (jp == '-') fh = -1, jp = getchar();
  while (jp >= '0' && jp <= '9') out = out * 10 + jp - '0', jp = getchar();
  return out * fh;
}
const int MAXN = 1e5 + 10;
int n, a[MAXN];
set<int> s;
map<int, int> p;
set<int>::iterator it;
bool judge() {
  for (int i = 1; i <= n; ++i) {
    s.insert(a[i]);
    ++p[a[i]];
  }
  if (n % 3 == 0) {
    if (s.size() > 3) return false;
    int sz = s.size();
    int x[3];
    it = s.begin();
    for (int i = 0; i < 3; ++i) {
      x[i] = *it;
      if (s.size() > 1) s.erase(it);
      it = s.begin();
    }
    if (sz == 3)
      return (x[0] ^ x[1] == x[2]) && p[x[0]] == n / 3 && p[x[1]] == n / 3;
    if (sz == 2) return x[0] == 0 && p[x[0]] == n / 3;
    if (sz == 1) return x[0] == 0;
  }
  return s.size() == 1;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  if (judge())
    puts("Yes");
  else
    puts("No");
  return 0;
}
