#include <bits/stdc++.h>
int diff[4][2] = {
    {0, -1},
    {-1, 0},
    {1, 0},
    {0, 1},
};
int Min(int a, int b) { return (a) < (b) ? (a) : (b); }
int Max(int a, int b) { return (a) > (b) ? (a) : (b); }
long long Minl(long long a, long long b) { return (a) < (b) ? (a) : (b); }
long long Maxl(long long a, long long b) { return (a) > (b) ? (a) : (b); }
void hSwap(int x[], int i, int j) {
  int temp;
  temp = x[i];
  x[i] = x[j];
  x[j] = temp;
}
void ShowData(int x[], int left, int right) {
  int i;
  for (i = left; i <= right; i++) printf("%d  ", x[i]);
  printf("\n");
}
void QSort(int x[], int left, int right, int n) {
  int i, j;
  int pivot;
  i = left;
  j = right;
  pivot = x[(left + right) / 2];
  while (1) {
    if (n > 0) {
      while ((x[i] < pivot) && (i <= right)) i++;
      while ((pivot < x[j]) && (i <= right)) j--;
    } else {
      while ((x[i] > pivot) && (i <= right)) i++;
      while ((pivot > x[j]) && (i <= right)) j--;
    }
    if (i >= j) break;
    hSwap(x, i, j);
    i++;
    j--;
  }
  if (left < i - 1) QSort(x, left, i - 1, n);
  if (j + 1 < right) QSort(x, j + 1, right, n);
}
int main() {
  int n;
  scanf("%d", &n);
  int a[100000];
  for (int i = 0, i_len = (int)(n); i < i_len; i++) {
    scanf("%d", &a[i]);
  }
  QSort(a, 0, n - 1, 1);
  if ((a[0] ^ a[n / 3]) != a[n / 3 * 2]) {
    puts("No");
    return 0;
  }
  for (int i = (int)(1), i_len = (int)(n / 3); i < i_len; i++) {
    if (a[i] != a[0]) {
      puts("No");
      break;
    }
  }
  for (int i = (int)(n / 3 + 1), i_len = (int)(n / 3 * 2); i < i_len; i++) {
    if (a[i] != a[n / 3]) {
      puts("No");
      return 0;
    }
  }
  for (int i = (int)(n / 3 * 2 + 1), i_len = (int)(n); i < i_len; i++) {
    if (a[i] != a[n / 3 * 2]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
}
