#include <bits/stdc++.h>
using namespace std;
int n, a[220010];
int main() {
  int ok = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    if (a[i] < 0) ok = 0;
    if (!ok) break;
    if (a[i] % 2 == 1) a[i + 1]--;
  }
  if (ok) {
    if (a[n] % 2 == 1 || a[n] < 0) ok = 0;
  }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
