#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  S=regex_replace(S,regex("eraser"),"******");
  S=regex_replace(S,regex("erase"),"*****");
  S=regex_replace(S,regex("dreamer"),"*******");
  S=regex_replace(S,regex("dream"),"*****");
  cout<<(S==string(S.size(),'*')?"YES":"NO")<<endl;
}
