#include <bits/stdc++.h>
using namespace std;
long long a[1000005] = {}, dp[1000005] = {};
int main() {
  long long t = 0, n, m = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (m == 1 && a[i] == 0) {
      t = 1;
      break;
    }
    if (a[i] % 2 != 0) {
      m = (m + 1) % 2;
    }
  }
  if (m != 0 || t == 1)
    cout << "NO\n";
  else
    cout << "YES\n";
}
