#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> camels(n);
  for (int i = 0; i < n; i++) {
    cin >> camels[i];
  }
  if (n == 3) {
    vector<string> binary(3);
    int maxlen = 0;
    for (int i = 0; i < 3; i++) {
      string bin = bitset<32>(camels[i]).to_string();
      binary[i] = bin;
      int binsize;
      for (int j = 0; j < 32; j++) {
        if (bin[j] == '1') {
          binsize = 32 - j;
          break;
        }
      }
      if (binsize > maxlen) {
        maxlen = binsize;
      }
    }
    vector<int> counting(32, 0);
    for (int i = 0; i < 3; i++) {
      for (int j = 31; j >= 32 - maxlen; j--) {
        if (binary[i][j] == '1') {
          counting[j]++;
        }
      }
    }
    bool ans = true;
    for (int i = 31; i >= 32 - maxlen; i--) {
      if (counting[i] != 2) {
        ans = false;
      }
    }
    if (ans) {
      cout << "Yes";
    } else {
      cout << "No";
    }
  } else {
    cout << "No";
  }
  int l;
  cin >> l;
}
