#include <bits/stdc++.h>
int asc(const void *a, const void *b) {
  if (*(int *)a > *(int *)b) return 1;
  if (*(int *)b > *(int *)a) return -1;
  return 0;
}
int main(int argc, char *argv[]) {
  long long n, a[100000];
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  qsort(a, n, sizeof(long long), asc);
  if (n % 3 == 0) {
    int flag[3] = {};
    for (int i = 1; i <= 3; i++) {
      for (int j = (i - 1) * n / 3; j < i * n / 3; j++) {
        if (a[(i - 1) * n / 3] != a[j]) {
          flag[i - 1]++;
          break;
        }
      }
    }
    if (flag[0] == 0 && flag[1] == 0 && flag[2] == 0) {
      if ((a[0] ^ a[n / 3]) == a[2 * n / 3] &&
          (a[0] ^ a[2 * n / 3]) == a[n / 3] &&
          (a[n / 3] ^ a[2 * n / 3]) == a[0])
        printf("Yes\n");
      else
        printf("No\n");
    } else
      printf("No\n");
  } else
    printf("No\n");
  return 0;
}
