#include <bits/stdc++.h>
using namespace std;
int n, a = -1, b = -1, c = -1, as = 0, bs = 0, cs = 0;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (a == -1) a = x;
    if (a != x && b == -1) b = x;
    if (a != x && b != x && c == -1) c = x;
    if (a != x && b != x && c != x) {
      printf("No\n");
      return 0;
    }
    if (a == x) as++;
    if (b == x) bs++;
    if (c == x) cs++;
  }
  if (n % 3 != 0) {
    if (as == n)
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    if (b == -1 && c == -1)
      printf("Yes\n");
    else if (c == -1) {
      if (as < bs) swap(as, bs), swap(a, b);
      if (bs == n / 3 && b == 0)
        printf("Yes\n");
      else
        printf("No\n");
    } else {
      if (as == n / 3 && bs == n / 3 && (a ^ b) == c)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
}
