#include <bits/stdc++.h>
void swap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
int partition(int array[], int left, int right) {
  int i, j, pivot;
  i = left;
  j = right + 1;
  pivot = left;
  do {
    do {
      i++;
    } while (array[i] < array[pivot]);
    do {
      j--;
    } while (array[pivot] < array[j]);
    if (i < j) {
      swap(&array[i], &array[j]);
    }
  } while (i < j);
  swap(&array[pivot], &array[j]);
  return j;
}
void quick_sort(int array[], int left, int right) {
  int pivot;
  if (left < right) {
    pivot = partition(array, left, right);
    quick_sort(array, left, pivot - 1);
    quick_sort(array, pivot + 1, right);
  }
}
int main() {
  int N = 0;
  int a[1000000] = {0};
  int tmp;
  scanf("%d", &N);
  for (unsigned int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  quick_sort(a, 0, N);
  for (unsigned int i = 0; i < N - 2; i++) {
    tmp = a[i] ^ a[i + 2];
    if (tmp != a[i + 1]) {
      printf("NO");
      return 0;
    }
  }
  printf("Yes");
  return 0;
}
