#include <bits/stdc++.h>
using namespace std;
int dx8[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy8[8] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int prem[100001];
int prem2[100001];
int main() {
  int n;
  cin >> n;
  int c1 = 0, c2 = 0;
  multiset<int> s4, s2, oth;
  multiset<int> ts4, ts2, toth;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v[i] = a;
    if (a % 4 != 0 && a % 2 == 0) {
      ts2.insert(a);
      s2.insert(a);
    } else if (a % 4 == 0) {
      ts4.insert(a);
      s4.insert(a);
    } else {
      oth.insert(a);
      toth.insert(a);
    }
  }
  int ext = 0;
  if (ts2.size() == 1) {
    oth.insert(*ts2.begin());
    toth.insert(*ts2.begin());
    ts2.clear();
    s2.clear();
  }
  int idx = 0;
  int tidx = idx;
  while (s2.size()) {
    prem[idx] = *s2.begin();
    prem2[tidx] = *s2.begin();
    s2.erase(s2.begin());
    ts2.erase(ts2.begin());
    idx++;
    tidx++;
  }
  bool ok = 1;
  for (int j = idx; ok && j < n; j++) {
    if (j == 0) {
      if (s4.size() == 0) {
        ok = 0;
        break;
      }
      prem[j] = *s4.begin();
      s4.erase(s4.begin());
    } else {
      if (oth.size() == 0) continue;
      int val = *oth.begin();
      if ((prem[j - 1] * val) % 4 == 0) {
        prem[j] = val;
        oth.erase(oth.begin());
      } else if (s4.size() == 0) {
        ok = 0;
        break;
      } else {
        prem[j] = *s4.begin();
        s4.erase(s4.begin());
      }
    }
  }
  if (ok) {
    cout << "YES" << endl;
    return 0;
  }
  for (int j = tidx; j < n; j++) {
    if (j == 0) {
      if (toth.size() == 0) continue;
      int val = *toth.begin();
      prem2[j] = val;
      toth.erase(toth.begin());
    } else {
      if (toth.size() == 0) continue;
      int val = *toth.begin();
      if ((prem2[j - 1] * val) % 4 == 0) {
        prem2[j] = val;
        toth.erase(toth.begin());
      } else if (ts4.size() == 0) {
        cout << "NO" << endl;
        return 0;
      } else {
        prem2[j] = *ts4.begin();
        ts4.erase(ts4.begin());
      }
    }
  }
  cout << "YES" << endl;
}
