#include <bits/stdc++.h>
long int calc(long int b[], long int num);
long int a[100000];
long int n;
int main(void) {
  long int i, j;
  long int min, index;
  long int sum;
  long int work;
  long int flg = 0;
  long int x[100000];
  scanf("%ld", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }
  x[0] = 0;
  for (i = 1; i < n; i++) {
    x[1] = i;
    flg = calc(x, 2);
    if (flg) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
long int calc(long int b[], long int num) {
  long int work[100000];
  long int i, j;
  long int x, y, z = 0;
  long int flg;
  long int count;
  long int number[100];
  long int ret;
  long int kosu;
  if (num == n) {
    x = a[b[n - 2]];
    y = a[b[n - 1]];
    z = a[b[0]];
    while ((x > 0) || (y > 0) || (z > 0)) {
      if (((x % 2) + (z % 2)) % 2 != (y % 2)) {
        return 0;
      }
      x /= 2;
      y /= 2;
      z /= 2;
    }
    x = a[b[n - 1]];
    y = a[b[0]];
    z = a[b[1]];
    while ((x > 0) || (y > 0) || (z > 0)) {
      if (((x % 2) + (z % 2)) % 2 != (y % 2)) {
        return 0;
      }
      x /= 2;
      y /= 2;
      z /= 2;
    }
    return 1;
  }
  for (i = 0; i < num; i++) {
    work[i] = b[i];
  }
  x = a[work[num - 2]];
  y = a[work[num - 1]];
  count = 0;
  while ((x > 0) || (y > 0)) {
    if (((x % 2 == 1) && (y % 2 == 1)) || ((x % 2 == 0) && (y % 2 == 0))) {
      number[count] = 0;
    } else {
      number[count] = 1;
    }
    count++;
    x /= 2;
    y /= 2;
  }
  for (i = 0; i < count; i++) {
    z *= 2;
    if (number[count - 1 - i] == 1) {
      z++;
    }
  }
  flg = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == z) {
      flg = 1;
      for (j = 0; j < num; j++) {
        if (work[j] == i) {
          flg = 0;
          break;
        }
      }
      if (flg) {
        work[num] = i;
      }
    }
    if (flg) {
      kosu = num + 1;
      ret = calc(work, kosu);
      return ret;
    }
  }
  return 0;
}
