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