#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const int MOD = 100000000;
long long n, m, k = 0, q, c, w;
int a[200005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long cur = 0;
  bool f = 1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < 0) f = 0;
    a[i] = (a[i] & 1);
    if (a[i]) a[i + 1]--;
  }
  if (f && !(a[n - 1] & 1))
    puts("YES");
  else
    puts("NO");
  return 0;
}
