program main
 implicit none
 character(len=6) S
 character(len=1) a(6)
 integer i

 read *, S

 do i=1,6
  a(i)=S(i:i)
 end do

 if (a(3)==a(4) .and. a(5)==a(6) ) then
  print '(A)', 'Yes'
 else
  print '(A)', 'No'
 end if

endprogram main
