#include <bits/stdc++.h>
using namespace std;
int a[200010];
int main(void) {
  int i;
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i < n; i++) {
    if (a[i] % 2 == 0)
      continue;
    else {
      a[i + 1] = a[i + 1] - 1;
      if (a[i + 1] < 0) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  if (a[n] % 2 == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
