#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  std::cin >> n;
  std::vector<long long> v(n);
  std::map<long long, int> m;
  for (int i = 0; i < (n); ++i) {
    long long temp;
    std::cin >> temp;
    v[i] = temp;
    m[temp]++;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    bool flag = false;
    if (m[v[i] != 0]) {
      for (int j = i + 1; j < n; j++) {
        if (m[j] == 0) continue;
        bitset<30> bs1(v[i]);
        bitset<30> bs2(v[j]);
        long long cnt = 0;
        long long add = 1;
        for (int k = 0; k < (30); ++k)
          if (bs1[k] != bs2[k]) {
            cnt += add;
            add *= 2;
          }
        if (m[cnt] != 0) {
          m[v[i]]--;
          m[v[j]]--;
          m[cnt]--;
          flag = true;
          break;
        }
      }
      if (flag == false) {
        std::cout << "No" << '\n';
        return 0;
      }
    }
  }
  std::cout << "Yes" << '\n';
  return 0;
}
