#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.first != p2.first ? p1.first < p2.first : p1.second < p2.second;
}
long long dist(pair<long long, long long> p1, pair<long long, long long> p2) {
  return (p1.first - p2.first) * (p1.first - p2.first) +
         (p2.second - p1.second) * (p2.second - p1.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int array[n];
  for (int i = 0; i < n; i++) cin >> array[i];
  bool flag = true;
  for (int i = 0; i < n; i++) {
    array[i] %= 2;
    if (array[i] == 1 && i + 1 < n) {
      if (array[i] + array[i + 1] >= 2)
        array[i + 1] -= 1;
      else {
        flag = false;
        break;
      }
    }
  }
  if (array[n - 1] != 0) flag = false;
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
