#include <bits/stdc++.h>
bool hann(unsigned int a, unsigned int b, unsigned int c);
int main(void) {
  unsigned int n;
  unsigned int i, j;
  bool ell = false;
  scanf("%u", &n);
  unsigned int ar[n];
  for (j = 0; j < n; j++) scanf("%u ", &ar[j]);
  ell = hann(ar[n - 1], ar[0], ar[1]);
  for (i = 1; i < n - 1; i++) {
    ell = hann(ar[i - 1], ar[i], ar[i + 1]);
  }
  ell = hann(ar[n - 2], ar[n - 1], ar[0]);
  if (ell) printf("Yes");
  return 0;
}
bool hann(unsigned int a, unsigned int b, unsigned int c) {
  if (a ^ c == b) {
    return true;
  } else {
    printf("No");
    exit(0);
  }
}
