#include using namespace std; int main() { int n; cin >> n; map m; int ma = -1; for (int i = 0; i < n; ++i) { string a; cin >> a; m[a]++; ma = max(ma, m[a]); } if (ma <= ceil((double)n / 2) ) puts("YES"); else puts("NO"); return 0; }