#include <bits/stdc++.h>
bool is_right(long long int *p, long long int n, long long int i);
int main(void) {
  long long int n, i;
  scanf("%lld", &n);
  long long int a[n];
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (i = 0; i < n; i++) {
    if ((a[i] * a[i + 1]) % 4 != 0 && is_right(a, n, i) == 0) {
      printf("No");
      exit(0);
    }
  }
  printf("Yes");
}
bool is_right(long long int *p, long long int n, long long int i) {
  long long int top, k = 0, j = 1;
  if (i == n - 2) {
    while (p[i] * p[i + 1] % 4 != 0 && k < n - 3) {
      if (p[i + 1] * p[j] % 4 == 0) {
        top = p[i + 1];
        p[i + 1] = p[k];
        p[k] = top;
        k++;
      }
    }
    if (p[i] * p[i + 1] % 4 == 0)
      return true;
    else
      return false;
  } else {
    while ((p[i] * p[i + 1]) % 4 != 0 && k < n - i - 1) {
      top = p[i + 1];
      p[i + 1] = p[i + j + 1];
      p[i + j + 1] = top;
      j++;
      k++;
    }
    if (p[i] * p[i + 1] % 4 == 0)
      return true;
    else
      false;
  }
}
