#include <bits/stdc++.h>
int N;
int a[200000];
int main(void) {
  int i, j;
  int kazu[4] = {0};
  int count[4] = {0};
  int slot = 0;
  int yes = 1;
  if (scanf("%d", &N) != 1) return 1;
  for (i = 0; i < N; i++) {
    if (scanf("%d", &a[i]) != 1) return 1;
  }
  for (i = 0; i < N; i++) {
    int found = 0;
    for (j = 0; j < 4 && j < slot; j++) {
      if (kazu[j] == a[i]) {
        found = 1;
        count[j]++;
      }
    }
    if (!found && slot < 4) {
      kazu[slot] = a[i];
      count[slot] = 1;
      slot++;
    }
  }
  if (N % 3 != 0)
    yes = 0;
  else if (slot != 3)
    yes = 0;
  else if (count[0] != count[1] || count[1] != count[2])
    yes = 0;
  else if ((kazu[0] ^ kazu[1]) != kazu[2])
    yes = 0;
  puts(yes ? "Yes" : "No");
  return 0;
}
