#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  bool firstflag = false;
  bool secondflag = false;
  int n;
  cin >> n;
  int a[n];
  int collect[n];
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
  }
  int x;
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (n); j++) {
      if (i == j) {
        continue;
      }
      x = a[i] ^ a[j];
      for (int k = (0); k < (n); k++) {
        if (i == k || j == k) {
          continue;
        }
        if (x == a[k]) {
          firstflag = true;
          collect[0] = i;
          collect[1] = k;
          collect[2] = j;
          break;
        }
      }
    }
  }
  if (firstflag == false) {
    cout << "No" << endl;
    return 0;
  }
  int index = 1;
  int c = 3;
  while (n != c) {
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (c); j++) {
        if (i == collect[j]) {
          break;
        }
        if ((a[collect[index]] | a[collect[index + 1]]) == a[i]) {
          secondflag = true;
          collect[c] = i;
          c++;
          break;
        }
      }
      if (secondflag == true) {
        break;
      }
    }
    if (secondflag == false) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
