#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  bool flg = true;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    if (a[i] != 0) flg = false;
  }
  if (flg)
    cout << "Yes" << endl;
  else if (N % 3 != 0)
    cout << "No" << endl;
  else {
    cerr << "aji" << endl;
  }
}
