#include <bits/stdc++.h>
using namespace std;
int bitplus(string a, string b) {
  int ans = 0;
  for (int i = 0; i < 32; i++) {
    if ((a[i] == '1' && b[i] == '1') || (a[i] == '0' && b[i] == '0')) {
    } else {
      ans += pow(2, 31 - i);
    }
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<string> a(n);
  int ai[n];
  string ans = "Yes";
  stringstream ins;
  for (int i = 0; i < n; i++) {
    cin >> ai[i];
    stringstream ins;
    ins << bitset<64>(ai[i]);
    a[i] = ins.str();
  }
  for (int i = 0; i < n - 1; i++) {
    bool flag = true;
    for (int j = i + 1; j < n; j++) {
      int ab = bitplus(a[i], a[j]);
      int amin = 0;
      int amax = n;
      int amid;
      while (1) {
        amid = (amin + amax) / 2;
        if (ai[amid] == ab) {
          flag = false;
          break;
        }
        if (amin > amax) {
          break;
        }
        if (ai[amid] > ab) {
          amax = amid - 1;
        } else {
          amin = amid + 1;
        }
      }
      if (!flag) {
        break;
      }
    }
    if (flag) {
      ans = "No";
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
