#include <iostream>
#include <string>
#include <regex>

int main()
{
  using namespace std;
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

  string S;
  regex re(R"(^(?:dream(?:er)?|eraser?)+$)"); 

  cin >> S;
  cout << (regex_match(S, re) ? "YES" : "NO") << endl;
  
  return 0;
}
