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