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