n = gets.to_i list = STDIN.map{|s|s.split.map(&:to_i)}.map{|a|a[0] - a[1] * 30000} if list.max * 6 >= 3000000 print 'YES' ans = list.index(list.max) + 1 6.times{ print "\n" print ans } else print 'NO' end