#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n - 1; i++) {
    if (a[i - 1] * a[i] * a[i + 1] % 4 != 0) {
      k = 1;
      break;
    }
  }
  if (a[0] * a[1] % 4 != 0 || a[n - 1] * a[n - 2] % 4 != 0 || k == 1)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
