#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, arr[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int temp = 1, max = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] == arr[i - 1]) {
      temp++;
      if (temp > max) {
        max = temp;
      }
    } else {
      temp = 1;
    }
  }
  cout << (max <= (n + 1) / 2 ? "YES" : "NO");
}
