import qualified Data.ByteString.Char8 as BS
main = do
  xs <- BS.getLine
  putStrLn $ if solve $ BS.reverse xs then "YES" else "NO"

solve :: BS.ByteString -> Bool
solve xs
  | BS.empty == xs = True
  | (BS.unpack $ BS.take 5 xs) == reverse "dream" = solve $ BS.drop 5 xs
  | (BS.unpack $ BS.take 7 xs) == reverse "dreamer" = solve $ BS.drop 7 xs
  | (BS.unpack $ BS.take 5 xs) == reverse "erase" = solve $ BS.drop 5 xs
  | (BS.unpack $ BS.take 6 xs) == reverse "eraser" = solve $ BS.drop 6 xs
  | otherwise = False