#include <bits/stdc++.h>
template <typename T>
std::istream& operator>>(std::istream& input, std::vector<T>& v) {
  for (T& a : v) input >> a;
  return input;
}
void answer(bool v) {
  constexpr const char* s[2] = {"NO", "YES"};
  std::cout << s[v] << '\n';
}
void solve(std::vector<unsigned>& a) {
  unsigned s = 0;
  for (const unsigned x : a) {
    s += x;
    if (x == 0 && s % 2 != 0) break;
  }
  answer(s % 2 == 0);
}
int main() {
  size_t n;
  std::cin >> n;
  std::vector<unsigned> a(n);
  std::cin >> a;
  solve(a);
  return 0;
}
