#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 50;
const int INF = 1 << 30;
int a[200000 + 50];
int dp[200000 + 50];
int main() {
  int n;
  long long sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  int cnt = 0, tmp = 0;
  bool flag = true;
  if (sum % 2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    tmp = (a[i] - cnt) / 2;
    cnt = a[i] - 2 * tmp - cnt;
    if (tmp >= 0 && cnt >= 0)
      continue;
    else {
      flag = false;
      break;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
