#include <bits/stdc++.h>
using namespace std;
int A[200005];
bool dp[200005][4];
int main() {
  int n, i;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> A[i];
  dp[0][0] = true;
  for (i = 1; i <= n; i++) {
    if (A[i] % 2 == 0 && (dp[i - 1][0] || dp[i - 1][2])) dp[i][0] = true;
    if (A[i] % 2 && (dp[i - 1][0] || dp[i - 1][2])) dp[i][1] = true;
    if (A[i] % 2 && (dp[i - 1][1] || dp[i - 1][3])) dp[i][2] = true;
    if (A[i] >= 2 && A[i] % 2 == 0 && (dp[i - 1][1] || dp[i - 1][3]))
      dp[i][3] = true;
  }
  if (dp[n][0] || dp[n][2])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
