#include <bits/stdc++.h>
typedef struct Val {
  int miVal;
  int miCnt;
} Val;
static FILE *szpFpI;
int fOut(char *pcpLine) {
  char lc1Buf[1024];
  printf("%s", pcpLine);
  return 0;
}
int fMain() {
  int i, j;
  char lc1Buf[1024];
  int liACnt;
  fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
  sscanf(lc1Buf, "%d", &liACnt);
  if (liACnt % 3 != 0) {
    return -1;
  }
  Val lz1Val[3];
  memset(lz1Val, 0, sizeof(lz1Val));
  int liVCnt = 0;
  for (i = 0; i < liACnt; i++) {
    int liVal;
    fscanf(szpFpI, "%d", &liVal);
    for (j = 0; j < liVCnt; j++) {
      if (lz1Val[j].miVal == liVal) {
        lz1Val[j].miCnt++;
        break;
      }
    }
    if (j == liVCnt) {
      if (liVCnt >= 3) {
        return -1;
      }
      lz1Val[liVCnt].miVal = liVal;
      lz1Val[liVCnt].miCnt = 1;
      liVCnt++;
    }
  }
  fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
  for (i = 0; i < 3; i++) {
    int liNo2 = (i + 1) % 3;
    int liNo3 = (i + 2) % 3;
    int liXor = lz1Val[i].miVal ^ lz1Val[liNo2].miVal;
    if (liXor != lz1Val[liNo3].miVal) {
      return -1;
    }
  }
  for (i = 1; i < 3; i++) {
    if (lz1Val[0].miCnt != lz1Val[i].miCnt) {
      return -1;
    }
  }
  return 0;
}
int fOne() {
  int liRet;
  char lc1Buf[1024];
  szpFpI = stdin;
  liRet = fMain();
  if (liRet == 0) {
    sprintf(lc1Buf, "Yes\n");
  } else {
    sprintf(lc1Buf, "No\n");
  }
  fOut(lc1Buf);
  return 0;
}
int main() {
  fOne();
  return 0;
}
