n = int(input()) re = 30000 * 100 pair = [] ef = 0 index = 0 for i in range(n): ex, d = map(int, input().split()) if ex - 30000*d > ef: ef = ex - 30000*d index = i+1 if ef * 6 >= re: print('YES') for i in range(6): print(index) else: print('NO')