import Data.List
import Data.Maybe (catMaybes)

deleteAny :: String -> [Maybe String]
deleteAny [] = []
deleteAny xs = map (`stripPrefix` xs) ["maerd", "remaerd", "esare", "resare"]

solve :: String -> String
solve xs = if null s then xs else solve (head s)
    where s = catMaybes $ deleteAny xs

main :: IO ()
main = do
    s <- reverse <$> getLine
    putStrLn $ if null (solve s) then "YES" else "NO"
