#include <bits/stdc++.h>
const int maxn = 2e5 + 5;
using namespace std;
bool flag, over;
int a[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] % 2 == 1) {
    flag = 1;
  }
  for (int i = 1; i < n; i++) {
    if (flag) {
      a[i]--;
      if (a[i] < 0) {
        over = 1;
        break;
      }
    }
    a[i] = a[i] % 2;
    if (a[i] == 0)
      flag = 0;
    else
      flag = 1;
  }
  if (flag) {
    cout << "NO";
  } else {
    if (over == 1)
      cout << "NO";
    else
      cout << "YES";
  }
}
