n=gets.to_i; a = 0; id = 0; n.times do |i| g,d=gets.split.map(&:to_i); b=[a,g-30000*d].max; if a < b then id = i; a=b; end end if a*6>=30000*100 then; puts "YES"; 6.times { puts id + 1; } else puts "NO"; end