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