#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int main() {
  int n, a[N];
  while (cin >> n) {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n - 2; i++) {
      if ((a[i] * a[i + 1]) % 4 != 0) flag = 1;
    }
    if (flag == 1)
      printf("NO");
    else
      printf("YES");
  }
}
