#include <bits/stdc++.h>
using namespace std;
template <typename lx>
inline void read(lx &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; c < '0' || '9' < c; c = getchar())
    if (c == '-') f = -1;
  for (; '0' <= c && c <= '9'; c = getchar())
    x = (x << 1) + (x << 3) + (c ^ 48);
  x *= f;
  return;
}
template <typename lx>
inline void print(lx x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + 48);
  return;
}
const int inf = 2147483647;
const int maxn = 1e5 + 4;
int n, tot = 1, in;
int kind[3];
int sum[3];
bool ans = true;
int main() {
  read(n);
  read(in);
  kind[0] = in;
  sum[0] = 1;
  for (register int i = 2; i <= n; i++) {
    read(in);
    bool judge = false;
    for (register int j = 0; j < tot; j++) {
      if (kind[j] == in) {
        judge = true;
        sum[j]++;
        break;
      }
    }
    if (!judge) {
      if (tot == 3) {
        ans = false;
        continue;
      }
      kind[tot] = in;
      sum[tot] = 1;
      tot++;
    }
  }
  if (!ans) {
    puts("No");
    return 0;
  }
  if ((kind[0] ^ kind[2] == kind[1] || kind[0] ^ kind[1] == kind[2] ||
       kind[1] ^ kind[2] == kind[0]) &&
      sum[0] == sum[1] && sum[1] == sum[2])
    puts("Yes");
  else
    puts("No");
  return 0;
}
