#include <bits/stdc++.h>
int main() {
  int a = 0;
  scanf("%d", &a);
  int b[a];
  int check2 = 0;
  for (int i = 0; i < a; i++) {
    scanf("%d", &b[i]);
  }
  for (int f = 1; f < a - 1; f++) {
    if (b[f] == (b[f - 1] ^ b[f + 1])) {
      check2++;
    }
  }
  if (check2 == a - 2) {
    printf("Yes");
  } else {
    printf("No");
  }
  return 0;
}
