import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int N = Integer.parseInt(reader.readLine()); long REQUIRED_XP = 3000000; String[] inputs; long[] xps = new long[N]; for (int i = 0; i < N; i++) { inputs = reader.readLine().split(" "); long xp = Long.parseLong(inputs[0]); int death = Integer.parseInt(inputs[1]); xps[i] = 6*(xp - 30000 * death); } int dangeon = -1; for (int i = 0; i < N; i++) { if(REQUIRED_XP <= xps[i]) { dangeon = i; // break; } } if(dangeon!=-1){ System.out.println("YES"); for (int i = 0; i < 6; i++) { System.out.println(dangeon+1); } } else { System.out.println("NO"); } } }