#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int A[N];
  long long j = 1, k = 0;
  vector<vector<long long>> V(N, vector<long long>(1, -1));
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    while (A[i]) {
      if (A[i] > j) {
        j *= 2;
        k++;
      } else if (A[i] == j) {
        V[i].push_back(k);
        j = 1;
        k = 0;
        break;
      } else if (A[i] < j) {
        V[i].push_back(k - 1);
        A[i] -= j / 2;
        j = 1;
        k = 0;
      }
    }
  }
  vector<long long> W(N, 0);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < V[i].size(); j++) {
      W[V[i][j]]++;
    }
  }
  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;
}
