use std::{collections::HashMap, io::Read}; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut s = s.split_whitespace(); let n: u8 = s.next().unwrap().parse().unwrap(); let mut h = HashMap::new(); s.for_each(|o| *h.entry(o).or_insert(0) += 1); println!( "{}", if h.iter().all(|(_k, v)| v - 1 <= n - v) { "YES" } else { "NO" } ); }