#include <bits/stdc++.h>
int compare(const void *a, const void *b) {
  if (*(int *)a > *(int *)b) return 1;
  return -1;
}
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  int set[3] = {-1, -1, -1};
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (set[0] == -1 || set[0] == a[i]) {
      set[0] = a[i];
    } else if (set[1] == -1 || set[1] == a[i]) {
      set[1] = a[i];
    } else if (set[2] == -1 || set[2] == a[i]) {
      set[2] = a[i];
    } else {
      printf("No");
      return 0;
    }
  }
  qsort(set, 3, sizeof(int), compare);
  qsort(a, n, sizeof(int), compare);
  if (set[0] == -1) {
    if ((set[1] == -1 && set[2] == 0) || (set[1] == 0 && n % 3 == 0)) {
      int zc = 0;
      for (int i = 0; i < n; i++) {
        if (a[i] == 0)
          zc++;
        else {
          break;
        }
      }
      if (zc == n || zc == n / 3) printf("Yes");
    } else {
      printf("No");
    }
    return 0;
  }
  if (set[0] ^ set[1] == set[2]) {
    int x = 0, y = 0, z = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] == set[0]) x++;
      if (a[i] == set[1]) y++;
      if (a[i] == set[2]) z++;
    }
    if (x == y && y == z) printf("Yes");
  } else {
    printf("No");
  }
  return 0;
}
