#include <bits/stdc++.h>
using namespace std;
unordered_map<long, long> foo;
void solve() {
  long N;
  cin >> N;
  for (long i = 0; i < N; i++) {
    long tmp;
    cin >> tmp;
    foo[tmp]++;
  }
  if (N % 3 != 0) {
    if (foo[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return;
  }
  for (auto it : foo) {
    if (it.second == 0) continue;
    if (it.second % (N / 3) != 0) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}
