program beginning
  implicit none
  integer :: n(4), x(0:9) = 0, i
  read(*,*) n
  do i = 1, 4
    x(n(i)) = x(n(i))+1
  end do
  if (x(1) == 1 .and. x(4) == 1 .and. x(7) == 1 .and. x(9) == 1) then
    write(*,'(a)') "YES"
  else
    write(*,'(a)') "NO"
  end if
end program beginning