#include <bits/stdc++.h>
int main(void) {
  int i, j, tmp, n, k[5], cnt = 0;
  scanf("%d", &n);
  scanf("%d", &k[cnt++]);
  for (i = 1; i < n; i++) {
    scanf("%d", &tmp);
    for (j = 0; j < cnt; j++) {
      if (k[j] != tmp) {
        k[cnt++] = tmp;
        break;
      }
    }
    if (cnt > 3) {
      printf("No");
      return 0;
    }
  }
  if (n % 3 != 0)
    printf("No");
  else {
    if (cnt == 3) {
      if (k[0] ^ k[1] == k[2]) {
        printf("Yes");
      } else {
        printf("No");
      }
    } else if (cnt == 2) {
      if (k[0] == 0 || k[1] == 0) {
        printf("Yes");
      } else {
        printf("No");
      }
    } else if (cnt == 1) {
      if (k[0] == 0)
        printf("Yes");
      else
        printf("No");
    }
  }
  return 0;
}
