#include <bits/stdc++.h>
using namespace std;

int main(){
  string S;
  cin >> S;
  reverse(S.begin(),S.end());
  int s=S.size();
  for(int i=0;i<s;i++){
    if(S.substr(i,5)=="maerd"){i+=4;}
    else if(S.substr(i,7)=="remaerd"){i+=6;}
    else if(S.substr(i,5)=="esare"){i+=4;}
    else if(S.substr(i,6)=="resare"){i+=5;}
    else{cout << "NO" << endl; return 0;}
  }
  cout << "YES" << endl;
}