import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from operator import itemgetter N = int(readline()) m = map(int,read().split()) GD = zip(m,m) exps = [g - 30000*d for g,d in GD] i, exp = max(enumerate(exps, 1), key=itemgetter(1)) if exp*6 >= 3*10**6: print('YES') print(*[i]*6, sep='\n') else: print('NO')