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