#include #include #include using namespace std; int n; string a[50]; map dict; int main(){ cin >> n; for( int i = 0; i < n; i++ ){ cin >> a[i]; if( dict.find(a[i]) == dict.end() ){ dict[a[i]] = 0; } dict[a[i]]++; } for( map::iterator it = dict.begin(); it != dict.end(); it++ ){ if( (*it).second > (n + 1) / 2 ){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }