import Data.List

main :: IO ()
main = do
    x <- fmap reverse getLine
    putStrLn (hantei "" x)

-- ここは他に回そうif as == bs then
hantei :: String -> String -> String
hantei as bs =  if as == bs then "Yes"
                else if isPrefixOf ("maerd" ++ as) bs then hantei ("maerd" ++ as) bs
                else if isPrefixOf ("remaerd" ++ as) bs then hantei ("remaerd" ++ as) bs
                else if isPrefixOf ("esare" ++ as) bs then hantei ("esare" ++ as) bs
                else if isPrefixOf ("resare" ++ as) bs then hantei ("resare" ++ as) bs
                else "No"

