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