program main
   implicit none 
   integer ::a(4)=0,hantei(4)=1
   integer i
   read(*,*)a
   do i=1,4
      if(a(i)==1)hantei(1)=0
      if(a(i)==9)hantei(2)=0
      if(a(i)==7)hantei(3)=0      
      if(a(i)==4)hantei(4)=0
   enddo
   if(all(hantei==0))then
      write(*,"(a3)")"YES"
   else
      write(*,"(a2)")"NO"
   endif
end program main
