#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) {
    if (a[i] & 1) {
      if (i != n - 1) {
        a[i + 1]--;
        if (a[i + 1] < 0) {
          cout << "NO";
          exit(0);
        }
      }
    }
  }
  if (a[n - 1] % 2 == 1)
    cout << "NO";
  else
    cout << "YES";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) solve();
  return 0;
}
