#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int N; cin >> N; map m; for (int i = 0; i < N; ++i) { string a; cin >> a; m[a] += 1; } int l = 0; for (auto k:m) { l = max(l, k.second); } if ((N + 2 - 1) / 2 + 1 <= l) { cout << "NO" << endl; } else { cout << "YES" << endl; } return 0; }