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