DEATH = 30000 LIMIT = DEATH*100 N = int(input()) exp = 0 dungeon = 0 for i in range(N): g, d = map(int, input().split()) if exp < g - DEATH * d: exp = g - DEATH * d dungeon = i+1 if exp*6 >= LIMIT: print('YES') for i in range(6): print(dungeon) else: print('NO')