   program abc160a
      implicit none
      character(len=6)::S

         read *,S
         if(S(3:3)==S(4:4).and.S(5:5)==S(6:6)) then
            print *,'Yes'
         else
            print *,'No'
         end if
         stop

   end program abc160a