#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int, int> > qu2;
priority_queue<int> pq;
static const int NIL = -1;
int P[10010];
void init(int n) {
  for (int i = 0; i < n; ++i) P[i] = i;
}
int root(int a) {
  if (P[a] == a) return a;
  return (P[a] = root(P[a]));
}
bool is_same_set(int a, int b) { return root(a) == root(b); }
void unite(int a, int b) { P[root(a)] = root(b); }
double dot_product(complex<double> a, complex<double> b) {
  return (conj(a) * b).real();
}
double cross_product(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}
complex<double> projection(complex<double> p, complex<double> b) {
  return b * dot_product(p, b) / norm(b);
}
long long f[2001];
long long pw(long long x, long long y) {
  long long a = 1;
  while (y) {
    if (y & 1) {
      a = a * x % 1000000007;
    }
    x = x * x % 1000000007;
    y /= 2;
  }
  return a;
}
long long modinv(long long x) { return pw(x, 1000000007 - 2); }
long long comb(int n, int r) {
  if (n < r) {
    return 0;
  }
  return f[n] * modinv(f[r]) % 1000000007 * modinv(f[n - r]) % 1000000007;
}
int cal(int a, int b) {
  if ((a == 1 && b == 0) || (a == 0 && b == 1)) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int n;
  int a[n];
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  if (n != 3) {
    cout << "No" << endl;
    return 0;
  }
  sort(a, a + 3);
  int b[5][31];
  for (int i = 0; i < (int)(31); i++) {
    for (int j = 1; j <= (int)(3); j++) {
      b[j][i] = a[j - 1] % 2;
      a[j - 1] = a[j - 1] / 2;
    }
  }
  for (int i = 0; i < (int)(31); i++) {
    b[0][i] = b[3][i];
    b[4][i] = b[1][i];
  }
  for (int i = 0; i < (int)(31); i++) {
    for (int j = 1; j <= (int)(3); j++) {
      if (b[j][i] != cal(b[j - 1][i], b[j + 1][i])) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
