#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  int a[N];
  int i = 0;
  int decimal[N];
  int binary[N];
  int check = 0;
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    decimal[i] = a[i];
    binary[i] = 0;
  }
  int base = 1;
  for (i = 0; i < N; i++) {
    base = 1;
    while (decimal[i] > 0) {
      binary[i] = binary[i] + (decimal[i] % 2) * base;
      decimal[i] = decimal[i] / 2;
      base = base * 10;
    }
  }
  if (binary[1] == (binary[0] ^ binary[2])) {
    printf("Yes");
    return 0;
  }
  if (N > 4) {
    if (binary[2] == (binary[1] ^ binary[3])) {
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}
