#include <bits/stdc++.h>
using namespace std;
const int MX = 223456;
long long md = 1e9 + 7;
long long N, k;
map<char, int> mpp;
string s;
int arr[MX];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> arr[i];
  for (int i = 0; i < N; i++) {
    if (arr[i] < 0) {
      cout << "NO\n";
      return 0;
    }
    int m = arr[i] % 2;
    if (i != N - 1) arr[i + 1] -= m;
    if (i == N - 1 && m) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
