#include <bits/stdc++.h>
int compare_ascending(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]);
  }
  if (n % 3 == 0) {
    qsort(a, n, sizeof(int), compare_ascending);
    int c = 1;
    for (int i = 1; i < n; i++) {
      if (a[i - 1] != a[i]) {
        c++;
      }
    }
    if (c == 1 || c > 3) {
      if (c == 1 && a[0] == 0) {
        printf("Yes");
      } else {
        printf("No");
      }
    } else {
      int d[3], e[3] = {0};
      d[0] = a[0];
      e[0] = 1;
      int x = 0;
      for (int i = 1; i < n; i++) {
        if (a[i] != a[i - 1]) {
          x++;
          d[x] = a[i];
        }
        e[x]++;
      }
      int t = n / 3;
      if ((d[0] == 0 && e[0] == t && e[1] == 2 * t && c == 2)) {
        printf("Yes");
      } else if (e[0] == t && e[1] == t && e[2] == t && c == 3) {
        if (d[0] ^ d[1] == d[2]) {
          printf("Yes");
        } else {
          printf("No");
        }
      } else {
        printf("No");
      }
    }
  } else {
    int f = 1;
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) {
        f = 0;
        break;
      }
    }
    if (f) {
      printf("Yes");
    } else {
      printf("No");
    }
  }
  return 0;
}
