#include <bits/stdc++.h>
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int zero_count = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      zero_count++;
    }
  }
  if (zero_count == n) {
    printf("Yes\n");
    return 0;
  }
  qsort(a, n, sizeof(int), compare_int);
  if (zero_count != 0 && n / 3 == zero_count) {
    int p = a[zero_count];
    for (int i = zero_count; i < n; i++) {
      if (p != a[i]) {
        printf("No\n");
        return 0;
      }
    }
    printf("Yes\n");
    return 0;
  }
  int p = a[0];
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (p == a[i]) {
      count++;
    } else {
      if (count != n / 3) {
        printf("No\n");
        return 0;
      } else {
        count = 1;
        p = a[i];
      }
    }
  }
  if ((a[0] ^ a[n / 3]) ^ a[n - 1] == 0) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
