Module Main
    Sub Main(args As String())
        Dim S As String = Console.ReadLine
        If S.Substring(2, 1) = S.Substring(3, 1) Then
            If S.Substring(4, 1) = S.Substring(5, 1) Then
                Console.WriteLine("Yes")
                End
            End If
        End If
        Console.WriteLine("No")
    End Sub
End Module