#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; map mp; for(int i = 0; i < n; i++) { string t; cin >> t; mp[t]++; } for(auto i : mp) { if(n % 2 == 0) { if(n - i.second < i.second) { cout << "NO" << endl; return 0; } } else { if(n - i.second + 1 < i.second) { cout << "NO" << endl; return 0; } } } cout << "YES" << endl; return 0; }