gets def get_nums gets.split.map(&:to_i) end def k_highest_scorer? get_nums.zip(get_nums).each_with_object(Hash.new(0)) { |(point, num), hash| hash[num] += point }.sort_by { |_, point| -point }.first[0] == 0 end puts k_highest_scorer? ? 'YES' : 'NO'