N = int(input()) need = 30000 * 100 GD = [list(map(int, input().split())) + [i] for i in range(N)] GD.sort(key = lambda x: x[0] - 30000 * x[1], reverse = True) if 6 * GD[0][0] - 180000 * GD[0][1] >= need: print("YES") for i in range(6): print(GD[0][2] + 1) else: print("NO")