#include <bits/stdc++.h>
using namespace std;
int n, i;
int main() {
  scanf("%d", &n);
  int wtf = 0;
  for (i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    x -= wtf;
    if (x < 0) {
      printf("NO\n");
      return 0;
    }
    if (x & 1)
      wtf = 1;
    else
      wtf = 0;
  }
  if (wtf)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
