#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int cnt = 0, n, b[1001];
  cin >> n;
  for (int j = 1; j <= n; j++) {
    cin >> b[j];
  }
  for (int j = 1; j < n - 1; j++) {
    if (b[j] + b[j + 1] % 4 == 0) cnt++;
  }
  if (cnt == 0)
    cout << "Yes";
  else
    cout << "No";
}
