program beginning
  implicit none
  integer :: n(4), i, j
  read(*,*) n(:)
  do i = 1, 4
     do j = i+1, 4
        if (n(i) .gt. n(j)) call swap(n(i),n(j))
     end do
  end do
  if (n(1) .eq. 1 .and. n(2) .eq. 4 .and. n(3) .eq. 7 .and. n(4) .eq. 9) then
     write(*,'(a)') 'YES'
  else
     write(*,'(a)') 'NO'
  end if
  stop
contains
  subroutine swap(a,b)
    implicit none
    integer, intent(inout) :: a, b
    integer                :: c
    c = a
    a = b
    b = c
    return
  end subroutine swap
end program beginning