#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll atcoder_mod = 1e9 + 7;
template <typename T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <typename T = int, typename C = vector<T>>
C vecin(int N) {
  C x(N);
  for (int i = 0; i < (N); ++i) {
    x[i] = in<T>();
  }
  return move(x);
}
void vout() { cout << endl; }
template <typename Head, typename... Tail>
void vout(Head&& h, Tail&&... t) {
  cout << ' ' << h;
  vout(forward<Tail>(t)...);
}
void out() { cout << endl; }
template <typename Head, typename... Tail>
void out(Head&& h, Tail&&... t) {
  cout << h;
  vout(forward<Tail>(t)...);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N = in();
  vector<int> V = vecin(N);
  int M = *max_element(V.begin(), V.end());
  int B = 0;
  while (M) {
    B++;
    M >>= 1;
  }
  vector<ll> one(B, 0), zero(B, 0);
  for (auto& x : V) {
    int v = x;
    for (int i = 0; i < (B); ++i) {
      if (v & 1)
        one[i]++;
      else
        zero[i]++;
      v >>= 1;
    }
  }
  for (int i = 0; i < (B); ++i) {
    ll A = one[i] * zero[i];
    ll C = one[i] * (one[i] - 1LL) / 2LL + zero[i] * (zero[i] - 1LL) / 2LL;
    if (A != one[i] || C != zero[i]) {
      out("No");
      return 0;
    }
  }
  out("Yes");
  return 0;
}
