#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, i;
  int a[1000000];
  int count = 1;
  scanf("%d", &n);
  if (n < 3) exit(0);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  quick_sort(a, 0, 1000000000);
  for (i = 0; i < n; i++) {
    if (i == 0) {
      if ((a[i + 1] ^ a[n - 1]) != a[i]) {
        count = 0;
      }
    } else if (i == (n - 1)) {
      if ((a[0] ^ a[i - 1]) != a[i]) {
        count = 0;
      }
    } else {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) {
        count = 0;
      }
    }
  }
  if (count == 1) printf("Yes\n");
  if (count == 0) printf("No\n");
  return 0;
}
