#include using namespace std; int main() { int N, ma = 0; cin >> N; map M; string A; while (cin >> A) ma = max(ma, ++M[A]); cout << ((ma <= (N + 1) / 2) ? "YES" : "NO") << "\n"; }