n = int(input()) d = 3 * 10**4 h = 3 * 10**6 c, it = 0, 0 for i in range(n): a, b = map(int, input().split()) a = a - b * d if a > c: c, it = a, i + 1 if c * 6 >= h: print("Yes", *[it] * 6, sep="\n") else: print("No")