#define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; int main(){ int N; cin >> N; map mp; for(int i = 0; i < N; i++){ string S; cin >> S; mp[S]++; } if(N%2 != 0) N++; int maxs = 0; for(auto p: mp){ maxs = max(maxs, p.second); } if(maxs <= N/2) cout << "YES" << endl; else cout << "NO" << endl; }