#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  int zero = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a == 0)
      zero++;
    else
      m[a]++;
  }
  if (m.size() == 3) {
    bool yes = true;
    for (auto &mi : m) {
      if (mi.second != (n - zero) / 3) {
        yes = false;
        break;
      }
      if (yes) {
        cout << "Yes" << '\n';
        return 0;
      }
    }
  } else if ((zero == n / 2 && m.size() == 1) || m.size() == 0) {
    cout << "Yes" << '\n';
    return 0;
  }
  cout << "No" << '\n';
  return 0;
}
