N = int(input()) g = 0 x = 0 for i in range(N): G, D = map(int, input().split()) if G - 30000 * D > g: g = G - 30000 * D x = i + 1 if g * 6 >= 3000000: print('YES') print(x, x, x, x, x, x, sep='\n') else: print('NO')