program coffee
    implicit none
    character s*6
    read *,s
    if (s(3:3) == s(4:4) .and. s(5:5) == s(6:6)) then
        print "('Yes'/)"
      else
        print "('No'/)"
    endif
end program coffee