#include <bits/stdc++.h>
using namespace std;
long long int n, m;
long long int aa[1000001];
int main() {
  scanf("%lld", &n);
  for (long long int i = 0; i < n; i++) scanf("%lld", &aa[i]);
  set<long long int> all;
  for (long long int i = 0; i < n; i++) all.insert(aa[i]);
  m = all.size();
  map<long long int, long long int> count;
  for (long long int i = 0; i < n; i++) count[aa[i]]++;
  if (count.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (count.size() == 0) {
    cout << "No" << endl;
    return 0;
  }
  if (count.size() == 1) {
    for (map<long long int, long long int>::iterator it = count.begin();
         it != count.end(); ++it)
      if (it->first == 0) {
        cout << "Yes" << endl;
        return 0;
      }
  }
  if (count.size() == 2) {
    for (map<long long int, long long int>::iterator it = count.begin();
         it != count.end(); ++it)
      if (it->first == 0) {
        if (it->second != n / 3) {
          cout << "No1" << endl;
          return 0;
        }
      } else {
        if (it->second != 2 * n / 3) {
          cout << "No2" << endl;
          return 0;
        }
      }
  }
  if (count.size() == 3) {
    for (map<long long int, long long int>::iterator it = count.begin();
         it != count.end(); ++it)
      if (it->second != n / 3) {
        cout << "No4" << endl;
        return 0;
      }
  }
  cout << "Yes" << endl;
  return 0;
}
