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

int main(){
  string c = "YES", S;
  cin >> S;
  reverse(S.begin(),S.end());
  string a[4]={"maerd","remaerd","esare","resare"};
  for(int i=0;i<S.size();){
    bool can=0;
    for(int j=0;j<4;j++){
      string d=a[j];
      if(S.substr(i,d.size())==d){
        i += d.size();
        can = 1;
      }
    }
    if(!can){
      c = "NO";
      break;
    }
  }
  cout << c << endl;
}
