import java.util.Scanner; public class No231 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); boolean cleable = false; int[] arrayG = new int[n]; //データ入力 for(int i = 0; i < n; i++){ int g = sc.nextInt(); int d = sc.nextInt(); //クリア可能かどうか判定 if((g - 30000 * d) >= 500000){ cleable = true; arrayG[i] = g - 30000 * d; } } sc.close(); //判定 if(!cleable){ System.out.println("NO"); }else{ System.out.println("YES"); for(int i = 0; i < n; i ++){ if(arrayG[i] < 500000){ continue; } int keikenti = 0; while(keikenti < 3000000){ keikenti += arrayG[i]; System.out.println(i + 1); if(keikenti >=3000000){ break; } } break; } } } }