import sys import math as mas n=int(input()) ma,to=0,0 for i in range(n): a,b=map(int,input().split()) if ma=500000: print("YES") print(*list(str(1+to))*6) # for i in range(6):print(to+1) else:print("NO") #for i in sys.stdin: # a,b=map(int,i.split()) # print(gcd(a,b),lcm(a,b))