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

int main() {
  string s;
  cin >> s;
  
  reverse(s.begin(), s.end());
  
  int i = 0;
  bool judge = true;
  while (i < s.size() && judge) {
    if (s.substr(i, 5) == "maerd" || s.substr(i, 5) == "esare")
      i += 5;
	else if (s.substr(i, 6) == "resare")
      i += 6;
	else if (s.substr(i, 7) == "remaerd")
	  i += 7;
	else
	  judge = false;
  }
  
  if (judge)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
