#include <bits/stdc++.h>
using namespace std;
const int mod = 'z' - 'a' + 1;
int dist1(int pos, char l) { return (pos - l + 'a' + mod) % mod; }
int dist2(int pos, char l) { return (l - 'a' + mod - pos) % mod; }
int main() {
  int n;
  cin >> n;
  vector<int> dp(n + 1);
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n; ++i) {
    dp[i] += arr[i - 1];
    if (dp[i - 1] % 2 != 0) {
      if (dp[i] < 1) {
        cout << "NO" << endl;
        return 0;
      }
      dp[i]--;
      dp[i - 1]--;
    }
  }
  if (dp[n] % 2 == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
