#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 5;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long cnt = 0;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    cnt += x;
    if ((cnt & 1) && (!x)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (cnt & 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
