n = int(input()) d = ((lambda y:y[0]-y[1]*30000)(list(map(int, input().split())))for x in range(n)) m, c=0, 0 for i, j in zip(d, range(n)): if i>m: m, c=i, j if m*6<30000*100: print('NO') else: print('YES') for i in range(6): print(c+1)