#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, flag = 0;
  cin >> n;
  vector<long long> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) flag++;
  }
  if (!(flag)) {
    cout << "Yes";
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  while (true) {
  }
}
