#include <bits/stdc++.h>
int main() {
  int N;
  int a[100001];
  int kouho[3] = {-1, -1, -1};
  int koushin = 0;
  scanf("%d\n", &N);
  int i;
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < N; i++) {
    if (a[i] != kouho[0] && a[i] != kouho[1] && a[i] != kouho[2]) {
      if (koushin < 3) {
        kouho[koushin] = a[i];
        koushin++;
      } else {
        koushin++;
      }
    }
  }
  int count1 = 0;
  int count2 = 0;
  int count3 = 0;
  for (i = 0; i < N; i++) {
    if (a[i] == kouho[0]) count1++;
    if (a[i] == kouho[1]) count2++;
    if (a[i] == kouho[2]) count3++;
  }
  if (koushin == 3 && count1 == count2 && count1 == count3 &&
      kouho[2] == (kouho[0] ^ kouho[1])) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
