program main
character*16 :: a
integer :: x,i,j

x=0
read(*,*) a
do i=1,4
do j=1,4
if(a(i:i) == a(j:j)) then
	x = x + 1
end if
end do
end do
write(*,*)x
if (x==8) then
write(*,*) "Yes"
else 
write(*,*) "No"
end if

end program main