#include <bits/stdc++.h>
using namespace std;
int arr[110];
int main() {
  int n, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int c = arr[0], t = 1, t1 = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] == c) {
      t1++;
    } else {
      c = arr[i];
      if (t1 > (n + 1) / 2) {
        cout << "NO" << endl;
        return 0;
      }
      t1 = 1;
    }
  }
  if (t1 > (n + 1) / 2) {
    cout << "NO" << endl;
  } else
    cout << "YES" << endl;
  return 0;
}
