import Data.List

main :: IO ()
main = do
    x <- getLine
    putStrLn (hantei2 x)

{-
    -- ここは他に回そうif as == bs then
    hantei :: String -> String -> String
    hantei as bs = if as == bs then "Yes"
        else if isSuffixOf ("eraser" ++ as) bs then hantei ("eraser" ++ as) bs
        else if isSuffixOf ("erase" ++ as) bs then hantei ("erase" ++ as) bs
        else if isSuffixOf ("dreamer" ++ as) bs then hantei ("dreamer" ++ as) bs
        else if isSuffixOf ("dream"  ++ as) bs then hantei ("dream"  ++ as) bs
        else "No"
-}

hantei2 :: String -> String
hantei2 as = if as == [] then "Yes"
        else if isSuffixOf "eraser" as then hantei2 $ reverse (drop 6 (reverse as))
        else if isSuffixOf "erase" as then hantei2 $ reverse (drop 5 (reverse as))
        else if isSuffixOf "dreamer" as then hantei2 $ reverse (drop 7 (reverse as))
        else if isSuffixOf "dream" as then hantei2 $ reverse (drop 5 (reverse as))
        else "No"