#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  unordered_map<int, int> input;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    input[tmp]++;
  }
  if (input.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> a;
  for (auto it : input) a.push_back(it.second);
  sort(a.begin(), a.end());
  if (input.size() == 3 && n % 3 == 0 && a[0] == a[1] && a[1] == a[2])
    cout << "Yes" << endl;
  else if (input.size() == 2) {
    if (n % 3 == 0 && a[0] * 2 == a[1])
      cout << "Yes" << endl;
    else if (n % 3 == 1 && ((a[0] - 1) * 2 == a[1] || a[0] * 2 == a[1] - 1))
      cout << "Yes" << endl;
    else if (n % 3 == 2 && (a[0] - 1) * 2 == a[1] - 1)
      cout << "Yes" << endl;
    else if (n % 3 == 2 && (a[0] - 2) * 2 == a[1])
      cout << "Yes" << endl;
    else if (n % 3 == 2 && a[0] * 2 == a[1] - 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (input.size() == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
