#include <bits/stdc++.h>
int DBG = 1;
int main() {
  int a[5], b[5], bb, b0, b1, f, c, i, j, k, n, m, x, y, ans = 0;
  char str[256];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  i = 0;
  f = 0;
  for (j = 1; j < n - 1; j++) {
    for (k = j + 1; k < n; k++) {
      if ((a[i] ^ a[k]) == a[j]) {
        f = 1;
        goto A;
      }
    }
  }
A:
  if (f) {
    b[0] = a[i];
    b[1] = a[j];
    b[2] = a[k];
    a[i] |= 0x80000000;
    a[j] |= 0x80000000;
    a[k] |= 0x80000000;
  } else {
    printf("No\n");
    return 0;
  }
  for (bb = 2; bb < n - 1; bb++) {
    b0 = bb - 1;
    b1 = bb + 1;
    f = 0;
    for (i = 1; i < n; i++) {
      if (a[i] < 0) continue;
      if ((b[b0] ^ a[i]) == b[bb]) {
        b[b1] = a[i];
        a[i] |= 0x80000000;
        f = 1;
        break;
      }
    }
    if (f == 0) {
      printf("No\n");
      return 0;
    }
  }
  if (b[0] ^ b[n - 2] == b[n - 1])
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
