#include <bits/stdc++.h>
int n;
int A[200010];
int main() {
  scanf("%d", &n);
  int i;
  for (i = 1; i <= n; i++) scanf("%d", &A[i]);
  for (i = 1; i < n; i++) {
    if (A[i] & 1) {
      if (A[i] <= 0 || A[i + 1] <= 0) {
        printf("NO\n");
        return 0;
      } else {
        A[i + 1]--;
      }
    }
  }
  if (A[n] & 1)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
