#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  int flag = 0;
  for (long long int i = 0; i < n; i++) {
    if (flag == 1) v[i]--;
    if (v[i] < 0) {
      flag = 1;
      break;
    }
    if (v[i] % 2 == 0) {
      flag = 0;
    } else {
      flag = 1;
    }
  }
  if (!flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
