fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn main() { use std::collections::HashMap; let n:usize = read(); let mut etom = HashMap::new(); for _i in 0..n { let eto:String = read(); let count = etom.entry(eto).or_insert(0); *count += 1; } let limit = if n % 2 == 0 { n / 2 } else { n - n / 2 }; let mut result = "YES"; for (_key, count) in &etom { if *count > limit { result = "NO"; break; } } println!("{}", result); }