#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
long long askx(long long a, long long b) {
  long long ans = 0;
  for (int i = 0; i < 30; i++) {
    if (b & (1 << i)) {
      if (a & (1 << i)) {
      } else {
        ans |= (1 << i);
      }
    } else {
      if (a & (1 << i)) {
        ans |= (1 << i);
      } else {
      }
    }
  }
  return ans;
}
long long n;
bool saiki(long long now, long long a, long long b,
           map<long long, long long> c) {
  if (now == n) {
    return true;
  }
  bool ok = false;
  long long x = askx(a, b);
  if (c[x] > 0) {
    c[x]--;
    if (saiki(now + 1, b, x, c)) {
      ok = true;
    } else {
      c[x]++;
    }
  }
  return ok;
}
int main() {
  long long a[100010];
  std::cin >> n;
  std::map<long long, long long> cou;
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
    cou[a[i]]++;
  }
  for (int i = 1; i < n; i++) {
    if (cou[askx(a[0], a[i])] > 0 && cou[askx(a[i], a[0])] > 0) {
      cou[a[0]]--;
      cou[a[i]]--;
      if (saiki(2, a[0], a[i], cou)) {
        std::cout << "Yes" << std::endl;
        return 0;
      }
      cou[a[0]]++;
      cou[a[i]]++;
    }
  }
  std::cout << "No" << std::endl;
}
