#include <bits/stdc++.h>
using namespace std;
int a[4], me[4];
int main() {
  int n, i, num, cnt = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> num;
    if (num == a[1])
      me[1]++;
    else if (num == a[2])
      me[2]++;
    else if (num == a[3])
      me[3]++;
    else if (num != a[1] && num != a[2] && num != a[3]) {
      a[++cnt] = num;
      me[cnt] = 1;
    }
    if (cnt > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  int ma = max(max(me[1], me[2]), me[3]);
  int mi = min(min(me[1], me[2]), me[3]);
  if (ma - mi <= 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
