#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using int64 = long long int;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
int main() {
  int N;
  cin >> N;
  bool all_zero = true;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    all_zero &= (A[i] == 0);
  }
  if (all_zero)
    cout << "Yes" << endl;
  else {
    map<int, int> cnt;
    for (auto e : A) cnt[e]++;
    if (cnt.size() != 3) {
      cout << "No" << endl;
    } else {
      vector<int> v;
      for (auto e : cnt) v.emplace_back(e.first);
      bool ok = true;
      for (int k = 0; k < 30; k++) {
        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < 3; i++) {
          int c = (v[i] >> k) & 1;
          (c ? cnt1 : cnt0)++;
        }
        ok &= (cnt0 == 3 or (cnt1 == 2 and cnt0 == 1));
      }
      cout << (ok ? "Yes" : "No") << endl;
    }
  }
  return 0;
}
