program abc
	implicit none
	character(len=6) :: fname
    character(len=1) :: a,b,c,d,e,f

	read(*,*) fname
	c = fname(3:3)
	d = fname(4:4)
	e = fname(5:5)
	f = fname(6:6)

    if(c == d .and. e == f) then
    	write(*,*) "Yes"
    else
    	write(*,*) "No"
    endif
    
end program abc