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