#include <bits/stdc++.h>
inline int re() {
  int x = 0;
  char ch;
  while ((ch = getchar()) > '9' && ch < '0')
    ;
  x = ch - 48;
  while ((ch = getchar()) >= '0' && ch <= '9') x = x * 10 + ch - 48;
  return x;
}
int n;
int flag;
int main() {
  n = re();
  flag = re() & 1;
  for (int i = 2, a; i <= n; i++) {
    a = re();
    if (a & 1)
      flag ^= 1;
    else if (!a && flag)
      break;
  }
  if (flag)
    printf("NO");
  else
    printf("YES");
  return 0;
}
