import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int req = 3000000, n = sc.nextInt(), max = 0, g, d; for(int i = 1; i <= n; i++){ g = sc.nextInt(); d = sc.nextInt(); if((g-30000*d)*6 >= req){ max = i; } } if(max == 0){ System.out.println("NO"); } else { System.out.println("YES"); for(int i = 0; i < 6; i++){ System.out.println(max); } } } }