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