#include <bits/stdc++.h>
using namespace std;
const int Log = 31, maxn = 1e5 + 5;
int n;
unordered_map<int, int> m;
bool provjeri(int a, int b) {
  unordered_map<int, int> minus;
  minus[a]++;
  minus[b]++;
  int c = a;
  int x;
  for (int i = 2; i < n; i++) {
    if (i == n - 1) {
      if (!(m[a ^ b] - minus[a ^ b])) {
        return 0;
      }
    } else {
      x = 0;
      for (int j = 0; j < Log; j++) {
        if (((1 << j) & b) != ((1 << j) & c)) {
          x += 1 << j;
        }
      }
      if (!(m[x] - minus[x])) {
        return 0;
      }
      c = b;
      b = x;
      minus[x]++;
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int a;
  vector<int> l;
  for (int i = 0; i < n; i++) {
    cin >> a;
    m[a]++;
    l.push_back(a);
  }
  int c;
  for (int i = 1; i < n; i++) {
    c = 0;
    for (int j = 0; j < Log; j++) {
      if (((1 << j) & l[0]) != ((1 << j) & l[i])) {
        c += 1 << j;
      }
    }
    if (m[c]) {
      if (provjeri(l[0], l[i])) {
        cout << "Yes\n";
        return 0;
      }
    }
  }
  cout << "No\n";
  return 0;
}
