#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i;
  cin >> N;
  vector<int> a(N);
  for (i = 0; i < N; i++) cin >> a[i];
  vector<short> count(1000000010);
  for (i = 0; i < 1000000010; i++) count[i] = 0;
  for (i = 0; i < N; i++) count[a[i]]++;
  if (N % 3 == 0) {
    for (i = 0; i < 1000000010; i++) {
      if (!(count[i] == 0 || count[i] == N / 3)) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  } else {
    if (count[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
