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