program sample
  implicit none

  integer(8) :: a,b,c,d,x(0:9)

  

  ! 整数を読み込む
  read(*,*) a,b,c,d
  x(:)=0
  x(a)=x(a)+1
  x(b)=x(b)+1
  x(c)=x(c)+1
  x(d)=x(d)+1
  if(x(1)==1 .and. x(4)==1 .and. x(7)==1 .and. x(9)==1)then
    write(*,*)'YES'
    else
    write(*,*)'NO'
    end if
  

  stop
end program sample
