#include <bits/stdc++.h>
const int N = 1e6 + 1;
using namespace std;
void solve() {
  int64_t n;
  cin >> n;
  vector<int64_t> v(n);
  for (int64_t i = 0; i < n; i++) cin >> v[i];
  bool f = true;
  for (int64_t i = 0; i < n - 1; i++) {
    if (v[i] % 2) {
      if (v[i + 1] == 0) {
        cout << "NO" << '\n';
        return;
      }
      v[i + 1]++;
      if (v[i + 1] % 2 != 0)
        f = false;
      else
        f = true;
    }
  }
  if (f && (v[n - 1] % 2 == 0))
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
