#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> v;
map<long long, long long> m;
long long find(long long a, long long b) {
  long long r = 0, p = 1;
  while (a + b > 0) {
    r += p * (a % 2 != b % 2);
    p *= 2;
    a /= 2;
    b /= 2;
  }
  return r;
}
bool f(long long k) {
  map<long long, long long> m1 = m;
  long long x, y, z;
  x = v[0], y = v[k];
  m1[x]--;
  m1[y]--;
  for (long long i = 2; i < n; i++) {
    z = find(x, y);
    if (*lower_bound(v.begin(), v.end(), z) == z) {
      m1[z]--;
      if (m1[z] < 0) return 0;
    } else
      return 0;
    x = y;
    y = z;
  }
  return find(x, y) == v[0];
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  m[v[0]] = 1;
  for (long long i = 1; i < v.size(); i++) {
    if (v[i] == v[i - 1])
      m[v[i]]++;
    else
      m[v[i]] = 1;
  }
  for (long long i = 1; i < n; i++) {
    if (i >= 2 && v[i] == v[i - 1]) continue;
    if (f(i)) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  cin >> n;
  return 0;
}
