AtCoder Beginner Contest 049
C
Daydream
AtCoder
⌀ 930
原题
← BD →
翻译中…

Problem Statement

翻译中…

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:

翻译中…
  • Append one of the following at the end of $T$: dream, dreamer, erase and eraser.
翻译中…

Constraints

翻译中…
  • $1≦|S|≦10^5$
  • $S$ consists of lowercase English letters.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

If it is possible to obtain $S = T$, print YES. Otherwise, print NO.

翻译中…

样例

Input #1
erasedream
Output #1
YES
Append `erase` and `dream` at the end of $T$ in this order, to obtain $S = T$.
Input #2
dreameraser
Output #2
YES
Append `dream` and `eraser` at the end of $T$ in this order, to obtain $S = T$.
Input #3
dreamerer
Output #3
NO
题目信息
题号
arc065_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。