people = gets.split.map(&:to_i) if people[0]+1 == people[1] puts "YES" puts 0 elsif people[0]+1 > people[1] puts "YES" puts people[0]+1 - people[1] elsif people[0]+1 < people[1] puts "NO" puts people[1] - (people[0]+1) end