#include #include using namespace std; int main() { int N; cin >> N; int ma = 0; map m; for(int i=0; i> a; ma = max(ma, ++m[a]); } if(ma > (N+1) / 2) { cout << "NO" << endl; } else { cout << "YES" << endl; } }