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