Module Main

    Sub Main()

        Dim strInputVal As String = ""                                         '入力文字列
        Dim strCompVal() As String = {"dream", "dreamer", "erase", "eraser"}   '比較文字列

        '入力値取得
        strInputVal = Console.ReadLine()

        For i As Integer = 0 To strCompVal.Length - 1

            '末尾の文字列と一致する場合
            If strInputVal.EndsWith(strCompVal(i)) Then

                Console.WriteLine("YES")
                Exit Sub

            End If
        Next

        Console.WriteLine("NO")

    End Sub

End Module