#include #include using namespace std; int main(int argc, const char* argv[]) { int N; cin >> N; string As[N]; for (auto&& a : As) cin >> a; map m; for (auto&& a : As) m[a]++; for (auto&& v : m) if (v.second > N / 2) { cout << "NO" << endl; return 0; } cout << "YES" << endl; return 0; }