N = int(input()) S = 3000000 _max = 0 index = -1 for _ in range(N): g,d = map(int,input().split()) if g - d * 30000 > _max: _max = g - d * 30000 index = _ + 1 if _max * 6 >= S: print('YES') for _ in range(6): print(index) else: print('NO')