{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ consisting of lowercase English letters. Another string $T$ is initially empty. Determine whether it is possible to obtain $S = T$ by performing the following operation an arbitrary number of times:\n\n*   Append one of the following at the end of $T$: `dream`, `dreamer`, `erase` and `eraser`."},{"iden":"constraints","content":"*   $1≦|S|≦10^5$\n*   $S$ consists of lowercase English letters."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"erasedream"},{"iden":"sample output 1","content":"YES\n\nAppend `erase` and `dream` at the end of $T$ in this order, to obtain $S = T$."},{"iden":"sample input 2","content":"dreameraser"},{"iden":"sample output 2","content":"YES\n\nAppend `dream` and `eraser` at the end of $T$ in this order, to obtain $S = T$."},{"iden":"sample input 3","content":"dreamerer"},{"iden":"sample output 3","content":"NO"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}