module Sort_Module
    implicit none
    public
    contains
    recursive subroutine mergesort(a, p, r, b)
        integer(8) a(:), b(:)
        integer(8) p, r
        integer(8) q
        if (p < r) then
            q = (p+r)/2
            call mergesort(a, p, q, b)
            call mergesort(a, q+1, r, b)
            call merge(a, p, q, r, b)
        end if
    end subroutine mergesort
    subroutine merge(a, p, q, r, b)
        integer(8) a(:), b(:)
        integer(8) p, r, q, i, j, k
        integer(8) t
        k = p;   i = p;   j = q+1
        do
            if (.not. (k <= r)) exit
            if (j > r) then
                t = a(i);   i = i+1
            else if (i > q) then
                t = a(j);   j = j+1
            else if (a(i) <= a(j)) then
                t = a(i);   i = i+1
            else
                t = a(j);   j = j+1
            end if
            b(k) = t;   k = k+1
        end do
        do i = p, r
            a(i) = b(i)  
        end do
    end subroutine merge
    subroutine sort(a)
      integer(8) a(:), b(size(a)),n
      n = size(a)
      call mergesort(a,1_8,n,b)
    end subroutine sort



end module Sort_Module

program atcoder
    use Sort_Module
    implicit none
    integer(8) :: a(4)
    read*,a(1),a(2),a(3),a(4)
    call sort(a)
    if(a(1)==1.and.a(2)==4.and.a(3)==7.and.a(4)==9)then
        write(*,'(a)')"YES"
    else
        write(*,'(a)')"NO"
    endif

    stop 
contains


end program atcoder