from random import choices as ch NEXT_LEVEL = 3000000 PENALTY = 30000 def is_nice_stage(exp, death): return (exp-death*PENALTY) >= NEXT_LEVEL/6 N = int(input()) stage = [(x+1, is_nice_stage(*map(int, input().split()))) for x in range(N)] stage = [x[0] for x in stage if x[1]] ans = "NO" if stage: ans = "YES\n"+"\n".join(map(str, ch(stage, k=6))) print(ans)