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 (as ++ "maerd") bs then hantei (as ++ "maerd") bs
                else if isPrefixOf (as ++ "remeard") bs then hantei (as ++ "remaerd") bs
                else if isPrefixOf (as ++ "esare") bs then hantei (as++ "esare") bs
                else if isPrefixOf (as ++ "resare") bs then hantei (as ++ "resare") bs
                else "No"

