#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int maxn = 2e5 + 500;
int dp[maxn][2], n, a[maxn];
int main(int argc, char* argv[]) {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i)
    for (int f = 0; f < 2; ++f)
      if (dp[i][f]) {
        if (f && a[i + 1] == 0) break;
        int s = a[i + 1];
        s -= f;
        if (s & 1) {
          dp[i + 1][1] = 1;
        } else {
          dp[i + 1][0] = 1;
        }
      }
  if (dp[n][0])
    puts("YES");
  else
    puts("NO");
  return 0;
}
