#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (c % 2 && a == 0) break;
    c += a;
  }
  if (c % 2)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
