# -*- coding:utf-8 -*-
while True:
	n,sumtime = raw_input().split(" ")
	n = int(n)
	sumtime = int(sumtime)
	minls = []
	maxls = []
	while n:

		imin,imax = raw_input().split(" ")
		minls.append( int(imin) )
		maxls.append(int(imax))
		n-=1
	if sum(maxls)< sumtime:
		print "No"
	elif sum(minls)>sumtime:
		print "No"
	else:
		print "Yes"
		leve = sumtime-sum(minls)

		for i in range(len(minls)):
			if leve ==0:
				break
			if leve>= (maxls[i]-minls[i]):
				leve -= maxls[i]-minls[i]
				minls[i] =maxls[i]
			else:
				minls[i] += leve
				leve = 0
		result = ""
		for h in minls:
			result = result+str(h)+" "
		print result