#include <iostream>
#include <string>
using namespace std;
 
int main(){
  string S;
  cin >> S;
  bool x = 1;
  for(int i = 0;i < S.length() && x;){
    if(S.substr(i,5) == "dream"){
      if(S.substr(i + 5,3) == "era")i += 5;
      else if(S.substr(i + 5,2) == "er")i += 7;
      else i += 5;
    }else if(S.substr(i,5) == "erase"){
      if(S[i + 5] == 'r')i += 6;
      else i += 5;
    }else x = 0;
  }
  if(x)cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}