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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using UMII = unordered_map <int, int>;
using UMIB = unordered_map <int, bool>;
using UMSI = unordered_map <string, int>;
using UMCI = unordered_map <char, int>;
using MII = map <int, int>;
using MIB = map <int, bool>;
using MSI = map <string, int>;
using MCI = map <char, int>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)
#define vint(v,n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vlint(v,n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v,n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v,n1,n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v,n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long int MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

//Multiple sort
void sort2vectors(vector<int> &av, vector<int> &bv)
{
        int n = av.size();
        vector<int> p(n), av2(n), bv2(n);
        iota(p.begin(), p.end(), 0);
        sort(p.begin(), p.end(), [&](int a, int b) { return av[a] < av[b]; });

        REP(i, n) {av2[i] = av[p[i]]; bv2[i] = bv[p[i]];}
        av = av2; bv = bv2;
}

//Greatest common divisor
int gcd(int a, int b)
{
    int c;
    if (a < b) { a+=b; b=a-b; a-=b;}
    while (b != 0) {c = a % b; a = b; b = c;}
    return a;
}
//Least common multiple
int lcm(int x, int y) {return (x * y / gcd(x, y));}

int isPrime(int x){
  int i;
  if(x < 2) return 0;
  else if(x == 2) return 1;
  if( x%2 == 0) return 0;
  for(i = 3; i*i <= x; i += 2){
    if(x%i == 0) return 0;
  }
  return 1;
}

const int pmax = 10000000;
bool isPrime_table[pmax];
//const is necessary;
void eratos(void){
  int i, j;
  double sqrtmax=sqrt(pmax);

  REP(k, pmax) isPrime_table[k] = true; /* Initialization */

  /* Sieve process  */
  isPrime_table[0] = false;
  isPrime_table[1] = false;
          /* 0 and 1 are not prime. */
  for (i=2; i <= sqrtmax; i++){
    if (isPrime_table[i]==true){   /* i is prime. */
      for (j=i; i*j<pmax; j++){
        isPrime_table[i*j] = false; /* multiples of i are not prime. */
      }
    }
  }
}
//漸化式敵に記述も可能
//abs(dx[i]+dy[j])==1で四方
int dx3[3]={-1, 0, 1};
int dy3[3]={-1, 0, 1};
int W0, H0;
int  masu0[100][100]={0};
int cnt0;

int dfs(int a, int b){
  masu0[a][b] = 2;
  REP(i, 3)REP(j, 3){
    a = a+dx3[i];
    b = b+dy3[j];
    if(masu0[a][b]== 1 && a >= 0 && a < W0 && b >= 0 && b < H0){
    dfs(a, b);
  }
  }
  return 1;
}

//文字列取り出し　s.substr(i, 5)
//文字数字変換 stoi, stod とto_string
//memset memset(dp, 0, sizeof(dp))
//複数配列のソート
//mapとsetのサイズ
//string:reverse
//str.find std::npos
//auto&&
//大文字小文字変換　tolower touuper
//hypot
//x.erase(remove(x.begin(), x.end(), 3), x.end());
int main(void){

  cin.tie(0);
  ios::sync_with_stdio(false);

  string S;
  cin >> S;

  int i = S.length()-1;
  while(i>=0){
    if(S.substr(i-4, 5) == "erase" || S.substr(i-4, 5) == "dream") i -= 5;
    else if (S.substr(i-5, 6) == "eraser") i -= 6;
    else if (S.substr(i-6, 7) == "dreamer") i -= 7;
    else{
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}


Measured memory_bytes: 512