Given a string
S
consisting of lowercase English letters and an empty string
T
. You can add one of the following words to the end of the
T
line:
dream
,
dreamer
,
erase code> and eraser
. Determine if it is possible to get S = T
.
Input
The input is the string S
(\(1<=S<=10^5\)), consisting of lowercase English letters (a-z
).
Imprint
If it is possible to get S = T
, print YES
. Otherwise, print NO
.
Examples
# |
Input |
Output |
1 |
erasedream
|
YES
|
2 |
dreameraser
|
YES
|
3 |
dreamer
|
NO
|