#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && (c != '-')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
const int N = 1e5 + 10;
int n, a[N], tot, q[4];
pair<int, int> p[N];
map<int, int> cnt;
int main() {
  n = read();
  for (register int i = (1); i <= (n); i++) cnt[a[i] = read()]++;
  for (auto i : cnt) p[++tot] = i;
  sort(p + 1, p + 1 + tot,
       [](pair<int, int> a, pair<int, int> b) { return a.second > b.second; });
  if (tot == 1) {
    if (p[1].first == 0)
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  if (n % 3) return puts("No"), 0;
  if (tot == 2) {
    if (p[2].second != n / 3) return puts("No"), 0;
    if (p[1].first != 0) return puts("No"), 0;
    return puts("Yes"), 0;
  }
  if (tot != 3) return puts("No"), 0;
  for (register int i = (1); i <= (tot); i++)
    if (p[i].second != n / 3) return puts("No"), 0;
  for (register int i = (1); i <= (3); i++) q[i] = i;
  do {
    bool flag = 1;
    for (register int i = (1); i <= (3); i++) {
      int l = i == 1 ? 3 : i - 1, r = i == 3 ? 1 : i + 1;
      if ((p[q[l]].first ^ p[q[r]].first) != p[q[i]].first) {
        flag = 0;
        break;
      }
    }
    if (flag) return puts("Yes"), 0;
  } while (next_permutation(q + 1, q + 1 + tot));
  puts("No");
}
