package yukicoder; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(read.readLine()); boolean[] flag = new boolean[N]; boolean yn = false; for (int i = 0; i < N; ++i) { String[] box = read.readLine().split(" "); int G = Integer.parseInt(box[0]); int D = Integer.parseInt(box[1]); if (G - (D * 30000) >= 500000) { flag[i] = true; yn = true; } } if (yn) { System.out.println("YES"); int count = 0; for (int i = 0; count < 6; ++i) { if (i / N == 1) { i = -1; } else if (flag[i]) { System.out.println(i + 1); count++; } } } else { System.out.println("NO"); } } catch (Exception e) { e.printStackTrace(); } } }