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