#include <bits/stdc++.h>
using namespace std;
int MY(int x) {
  int count = 1;
  int64_t now = 1;
  while (true) {
    now *= 2;
    if (now > x) {
      return count;
    }
    count++;
  }
}
int main() {
  int N;
  cin >> N;
  vector<int> gard(N);
  for (int i = 0; i < N; i++) {
    cin >> gard.at(i);
    gard.at(i) = MY(gard.at(i));
  }
  sort(gard.begin(), gard.end());
  gard.push_back(gard.at(N - 1) + 1);
  for (int i = 1; i < N - 1; i++) {
    if (gard.at(i) < gard.at(i + 1) && gard.at(i + 1) < gard.at(i + 2)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
