#include <bits/stdc++.h>
using namespace std;
int num[200005];
int vis[200005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
  }
  for (int i = 1; i < n; i++) {
    if (num[i] < 0) {
      cout << "NO" << endl;
      return 0;
    }
    if (num[i] % 2 == 1) {
      num[i + 1] = num[i + 1] - 1;
    }
  }
  if (num[n] < 0 || num[n] % 2 == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
