#include <bits/stdc++.h>
using namespace std;
int n, a[100005];
inline char nc() {
  static char buf[100000], *L = buf, *R = buf;
  return L == R && (R = (L = buf) + fread(buf, 1, 100000, stdin), L == R)
             ? EOF
             : *L++;
}
inline int read() {
  int ret = 0, f = 1;
  char ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = nc();
  return ret * f;
}
inline bool check1() {
  bool flg = 1;
  for (int i = 1; i <= n; i++)
    if (a[i]) flg = 0;
  return flg;
}
inline bool check2() {
  if (n % 3) return 0;
  int num = 0, lst = 0;
  for (int i = 1; i <= n; i++)
    if (a[i]) {
      if (lst)
        lst = a[i];
      else if (lst == a[i])
        num++;
    }
  if (num == (n / 3) * 2) return 1;
  return 0;
}
inline bool check3() {
  if (n % 3) return 0;
  int x, y, z, nx = 0, ny = 0, nz = 0;
  for (int i = 1; i <= n; i++) {
    if (!nx) {
      x = a[i];
      nx++;
      continue;
    }
    if (x == a[i]) {
      nx++;
      continue;
    }
    if (!ny) {
      y = a[i];
      ny++;
      continue;
    }
    if (y == a[i]) {
      ny++;
      continue;
    }
    if (!nz) {
      z = a[i];
      nz++;
      continue;
    }
    if (z == a[i]) {
      nz++;
      continue;
    }
    return 0;
  }
  if (nx == n / 3 && ny == n / 3 && nz == n / 3 && (x ^ y ^ z) == 0) return 1;
  return 0;
}
int main() {
  n = read();
  if (n < 3) {
    printf("Yes");
    return 0;
  }
  for (int i = 1; i <= n; i++) a[i] = read();
  if (check1()) {
    printf("Yes");
    return 0;
  }
  if (check2()) {
    printf("Yes");
    return 0;
  }
  if (check3()) {
    printf("Yes");
    return 0;
  }
  printf("No");
  return 0;
}
