use std::collections::HashMap; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut eto2count: HashMap = HashMap::new(); for _ in 0..n { let mut eto = String::new(); std::io::stdin().read_line(&mut eto).ok(); let eto: String = eto.trim().to_string().to_owned(); if let Some(x) = eto2count.get_mut(&eto) { *x += 1; } else { eto2count.insert(eto, 1); } } if (n + 1) / 2 < *eto2count.values().max().unwrap() { println!("NO"); } else { println!("YES"); } }