a,k=1,30000 for i in range(int(input())): g,d=input().split() if(int(g)-int(d)*k)*6-k*100+1:a,s=0,(str(i+1)+'\n')*6 print('NO'if a else'YES\n'+s[:-1])