#include <bits/stdc++.h>
using namespace std;
long long N;
int main() {
  cin >> N;
  vector<int> a(N);
  int mb = 0;
  int cnt = 1;
  int zer = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] == 0) zer = 1;
    int b = int(log2(a[i])) + 1;
    if (mb < b) {
      mb = b;
      cnt = 1;
    } else if (mb == b) {
      cnt += 1;
    }
  }
  if (zer)
    cout << "No " << endl;
  else {
    if (cnt % 2 == 0)
      cout << "Yes" << endl;
    else
      cout << "No " << endl;
  }
}
