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