#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  string s, ch = "";
  cin >> s;

  for (int i = s.length() - 1; i >= 0; --i) {
    ch.push_back(s[i]);
    if (ch == "maerd" || ch == "remaerd" || ch == "esare" || ch == "resare")
      ch = "";
  }

  cout << (ch == "" ? "YES" : "NO") << endl;
  return 0;
}
