integer a(4)
integer ans
read*,a(1),a(2),a(3),a(4)
ans=0
do i=1,4
  if(a(i)==1)then
    ans=ans+1
    exit
  end if
end do
do i=1,4
  if(a(i)==9)then
    ans=ans+1
    exit
  end if
end do
do i=1,4
  if(a(i)==7)then
    ans=ans+1
    exit
  end if
end do
do i=1,4
  if(a(i)==4)then
    ans=ans+1
    exit
  end if
end do
print"(A)",merge("YES"," NO",ans==4)
end