#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int x[200005];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) {
    if (x[i] < k) {
      cout << "NO" << endl;
      return 0;
    }
    k = (x[i] - k) % 2;
  }
  if (k)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
