import Data.List

main :: IO ()
main = do
    x <- getLine
    putStrLn (hantei "" 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"