#define NOT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<conio.h>

int main(void) {
  int i, flag = 0, j, k = 1,h;
  unsigned long N = 3;
  unsigned long a[100000];
  unsigned long b[100000];
  scanf_s("%d", &N);
  for (i = 1; i <= N; i++) {
    scanf_s("%d", a + i);
  }
  a[0] = a[N];
  a[N + 1] = a[1];
  for (h = 0; h <= N + 1; h++) {
    b[h] = a[h];
  }
  a[0] = a[N];
  a[N + 1] = a[1];
  for (h = 1; h <= N; h++) {
    for (i = 1; i <= N; i++){
      flag = 0;
      j = i - 1;
      k = i + 1;
      for (; j <= N - 1; j++) {
        for (k; k <= N + 1; k++) {
          if (a[i] == (a[j] ^ a[k])) {
            if (a[j] != a[i - 1]){
              a[i - 1] = a[i - 1] + a[j];
              a[j] = a[i - 1] - a[j];
              a[i - 1] = a[i - 1] - a[j];
            }
            if (a[k] != a[i + 1]) {
              a[i + 1] = a[i + 1] + a[k];
              a[k] = a[i + 1] - a[k];
              a[i + 1] = a[i + 1] - a[k];
            }
            flag = 1;
            goto brea;
          }
        }
      }
      brea:
      if (!flag) {
        break;
      }
    }
    if (flag) {
      printf("yes");
      return 0;
    }

    for (i = 0; i <= N + 1; i++) {
      a[i] = b[i];
    }
    for (i = 1; i <= N; i++) {
      a[i - 1] = a[i];
    }
    a[N + 1] = a[1];
    flag = 0;
  }
  printf("no");
  return 0;
}
