#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 5;
int a[N];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  a[n] = 0;
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    if (a[i] < 0) {
      ok = false;
      break;
    }
    if (a[i] & 1) {
      a[i + 1]--;
    }
  }
  if (a[n] == 0 && ok) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
