#include <bits/stdc++.h>
using namespace std;
int N;
vector<vector<long long>> V(100010, vector<long long>(1, -1));
long long j = 1, k = 0;
void solve(int &A, int &i) {
  if (A > j) {
    j *= 2;
    k++;
    solve(A, i);
  } else if (A == j) {
    V[i].push_back(k);
    j = 1;
    k = 0;
    return;
  } else if (A < j) {
    V[i].push_back(k - 1);
    A -= j / 2;
    j = 1;
    k = 0;
    solve(A, i);
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    solve(A[i], i);
  }
  vector<long long> W(100000, 0);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < V[i].size(); j++) {
      if (V[i][j] == -1) continue;
      W[V[i][j]]++;
    }
  }
  sort(W.begin(), W.end());
  W.erase(unique(W.begin(), W.end()), W.end());
  for (int i = 0; i < W.size(); i++) {
    if (W[i] == -1) continue;
    if (W[i] % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
