program beginning
	implicit none
    integer :: a,b,c,d,i
    logical :: status(4), ans
    
    read(*,*) a,b,c,d
    
    status=.false.
    
    i = 1
    if (a == i .or. b == i .or. c==i .or. d==i ) then
    	status(1)=.true.
    end if
    i = 9
    if (a == i .or. b == i .or. c==i .or. d==i ) then
    	status(2)=.true.
    end if
    i = 7
    if (a == i .or. b == i .or. c==i .or. d==i ) then
    	status(3)=.true.
    end if
    i = 4
    if (a == i .or. b == i .or. c==i .or. d==i ) then
    	status(4)=.true.
    end if
    
    do i = 1, 4
    	if ( status(i) == .false. ) then
        	write(*,*) 'NO'
            stop
        end if
	end do
    
    write(*,*) 'YES'
    
    stop
end program beginning