#!/usr/bin/python # -*- coding: utf-8 -*- n = int(raw_input()) gd = [map(int, raw_input().split()) for _ in xrange(n)] ok = 0 for i, (g, d) in enumerate(gd): v = (g - 30000 * d) * 6 if v >= 30000 * 100: ok = 1 break if not ok: print 'NO' else: print 'YES' print '\n'.join(map(str, [i+1] * 6))