#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n % 3 != 0) {
    int term = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) {
        term = 1;
        break;
      }
    }
    if (term == 1) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
  if (n % 3 == 0) {
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      sum += a[i];
    }
    if (sum % (2 * n / 3) == 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}
