#include <bits/stdc++.h>
const long long mod = 1000000007;
struct D {
  int a, n;
};
int search(D* d, int t, int n) {
  if (d[0].a == t) return 0;
  int r = 0;
  for (int i = 20; i >= 0; i--) {
    int c = r + 1 << i;
    if (c >= n) continue;
    if (d[c].a == t) return c;
    if (d[c].a < t) r = c;
  }
  return -1;
}
int main() {
  int N;
  scanf("%d", &N);
  int* a = new int[N];
  for (int i = 0; i < N; i++) {
    scanf("%d", a + i);
  }
  std::sort(a, a + N);
  std::vector<D> d;
  for (int i = 0; i < N; i++) {
    if (i != 0 && d[d.size() - 1].a == a[i]) {
      d[d.size() - 1].n++;
    } else {
      d.push_back({a[i], 1});
    }
  }
  bool can = false;
  d[0].n--;
  int n = d.size();
  for (int i = 0; i < n; i++) {
    int bb = d[0].a, b;
    if (d[i].n == 0) continue;
    b = d[i].a;
    int c = search(d.data(), bb ^ b, n);
    if (c != -1 && d[c].n > 0) {
      std::vector<D> e;
      for (int j = 0; j < n; j++) {
        e.push_back(d[j]);
      }
    }
  }
  printf(can ? "Yes" : "No");
  return 0;
}
