#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int cnt2 = 0;
  int cnt4 = 0;
  int other = 0;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    if (i % 4 == 0) {
      cnt4++;
      continue;
    }
    if (i % 2 == 0) {
      cnt2++;
      continue;
    }
    other++;
  }
  cnt2 = cnt2 >= 2 ? 2 : cnt2;
  if (cnt2 + other <= cnt4 * 2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
