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