#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::cin.ignore();
  int n = N;
  std::map<uint32_t, int> vals;
  while (n-- > 0) {
    uint32_t v;
    std::cin >> v;
    auto it = vals.find(v);
    if (it == vals.end()) {
      if (vals.size() == 3) {
        std::cout << "No" << std::flush;
        return 0;
      }
      vals[v] = 1;
    } else {
      ++it->second;
    }
  }
  if (vals.size() == 1 && vals.begin()->first == 0) {
    std::cout << "Yes" << std::flush;
  } else if (vals.size() == 2) {
    auto it = vals.begin();
    if (it->first != 0 || it->second != N / 3 || (++it)->second == 2 * N / 3) {
      std::cout << "No" << std::flush;
    } else {
      std::cout << "Yes" << std::flush;
    }
  } else if (vals.size() == 3) {
    auto it = vals.begin();
    if (it->second != (++it)->second || it->second != (++it)->second) {
      std::cout << "No" << std::flush;
    } else {
      std::cout << "Yes" << std::flush;
    }
  } else {
    std::cout << "No" << std::flush;
  }
}
