#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<int, int> as;
  bool has_zero = false;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    ++as[a];
    if (a == 0) has_zero = true;
  }
  bool ans = true;
  if (as.size() == 3 && !has_zero) {
    auto it = as.begin();
    int value = it->second;
    ++it;
    ans = value == it->second;
    ++it;
    ans = ans && value == it->second;
  } else if (as.size() == 1 && has_zero) {
    ans = true;
  } else if (as.size() == 2 && has_zero) {
    auto it = as.begin();
    int v1 = it->second;
    ++it;
    int k2 = it->first, v2 = it->second;
    if (k2 == 0) swap(v1, v2);
    ans = v1 * 2 == v2;
  } else
    ans = false;
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
