program main
	implicit none
	integer(8):: N,i,j,t,B,K
	integer,dimension(1:2*10**5)::B1,A    	
	read *, N, K 
    read(*,*) (A(i), i = 1, K),(B1(i), i = 1, K)
	do i=1,K
		if(A(i)==1.or.B1(i)==1)then
		print '(a)',"Yes"
		print '(i0)',A(i)
	    end if
	end do
			
end program main