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