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