#include <bits/stdc++.h>
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  qsort(a, n, sizeof(a[0]), compare_int);
  int value[2][3] = {{-1, -1, -1}, {0, 0, 0}};
  int flag = 0;
  int count_0 = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      if (value[0][j] < 0) {
        if (j == 0) {
          value[0][j] = a[i];
        } else if (value[0][(j + 1) % 3] >= 0 && value[0][(j + 2) % 3] >= 0) {
          value[0][j] = a[i];
        }
      }
      if (value[0][j] == a[i]) {
        value[1][j]++;
        break;
      }
    }
    if (a[i] == 0) {
      count_0++;
    }
  }
  if (count_0 == n) {
    flag = 1;
  }
  if (value[1][0] == value[1][1] && value[1][1] == value[1][2]) {
    if (value[1][0] * 3 == n) {
      if (value[0][0] == value[0][1] ^ value[0][2] ||
          value[0][1] == value[0][0] ^ value[0][2]) {
        flag = 1;
      }
    }
  }
  if (flag == 1) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
