#include #include #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int key = N / 2 + N % 2; map zodiac; for (int i = 0;i < N;i++) { string s; cin >> s; zodiac[s]++; if (zodiac[s] > key) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }