main :: IO ()
main = do
  str <- getLine
  putStrLn $ if solve str then "YES" else "NO"

solve :: String -> Bool
solve [] = True
solve ss
  | length6Str == "dreamer" || length6Str == "eraser"
  = solve $ drop 6 ss
  | length5Str == "dream" || length5Str == "erase"
    = solve $ drop 5 ss
  | otherwise = False
  where
    length6Str = take 6 ss
    length5Str = take 5 ss
