a = [] n = gets.to_i n.times do a += [gets.chomp!] end hash = a.inject(Hash.new(0)){|h, a| h[a] += 1; h} hash = hash.sort if hash[0][1].to_i >= n/2 puts "NO" else puts "YES" end