#include using namespace std; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) void YESorNO(bool p) { cout << (p ? "YES" : "NO") << endl; return; } int main() { map g; int n; cin >> n; rep(i,n) { string a; cin >> a; g[a]++; } bool flag = true; for (auto p : g) { if (p.second > (n + 1) / 2) flag = false; } YESorNO(flag); return 0; }