N = int(input()) s, si = 0, -1 for i in range(N): a, b = map(int, input().split()) ss = a - 30000 * b if ss > s: s = ss si = i if s >= 30000: print('YES') print('\n'.join([str(i)] * 6)) else: print('NO')