#include <bits/stdc++.h>
int comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int N;
  int a[100000];
  int i;
  int c;
  c = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    if (a[i] != 0) {
      c = 1;
    }
  }
  if (c == 0) {
    printf("Yes");
    return 0;
  }
  if (N % 3 != 0) {
    printf("No");
    return 0;
  }
  qsort(a, N, sizeof(int), comp);
  if (a[0] != a[N / 3 - 1] || a[N / 3] != a[2 * N / 3 - 1] ||
      a[2 * N / 3] != a[N - 1]) {
    printf("No");
    return 0;
  }
  if (a[0] ^ a[N / 3] == a[2 * N / 3]) {
    printf("Yes");
    return 0;
  }
  printf("No");
  return 0;
}
