Module Module049C
    Sub Main(ByVal args() As String)
        Dim S As String
        Dim i, j As Integer

        S = Console.ReadLine()

        Try
            For i = 0 To S.Length
                j = 0
                If S.Substring(i, 5) = "dream" Then
                    j = i + 4
                End If
                If S.Substring(i, 5) = "erase" Then
                    j = i + 4
                End If
                If S.Substring(i, 6) = "eraser" And S.Length = i + 6 Then
                    j = i + 5
                End If
                If S.Substring(i, 7) = "dreamer" And S.Length = i + 7 Then
                    j = i + 6
                End If
                If S.Substring(i, 6) = "eraser" And S(i + 6) <> "a" Then
                    j = i + 5
                End If
                If S.Substring(i, 7) = "dreamer" And S(i + 7) <> "a" Then
                    j = i + 6
                End If


                If j = 0 Then
                    Console.Write("No")
                    Exit Sub
                End If

                i = j
                If i = S.Length - 1 Then
                    Console.Write("Yes")
                    Exit Sub
                End If
            Next

        Catch ex As Exception
            If j = S.Length - 1 Then
                Console.Write("Yes")
            Else
                Console.Write("No")
            End If
            Exit Sub
        End Try

    End Sub
End Module
