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