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