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