//
//  main.cpp
//  atcoder049C
//
//  Created by zhangdenny on 2017/7/20.
//  Copyright © 2017年 Kirito. All rights reserved.
//

#include  <functional>
#include  <algorithm>
#include  <exception>
#include  <stdexcept>
#include  <streambuf>
#include  <iterator>
#include  <string.h>
#include  <stdlib.h>
#include  <typeinfo>
#include  <valarray>
#include  <iostream>
#include  <sstream>
#include  <istream>
#include  <stdio.h>
#include  <climits>
#include  <clocale>
#include  <complex>
#include  <csetjmp>
#include  <csignal>
#include  <cstdarg>
#include  <cstddef>
#include  <ctype.h>
#include  <cassert>
#include  <cstdlib>
#include  <utility>
#include  <cstring>
#include  <numeric>
#include  <ostream>
#include  <cwctype>
#include  <fstream>
#include  <iomanip>
#include  <math.h>
#include  <bitset>
#include  <cctype>
#include  <string>
#include  <vector>
#include  <limits>
#include  <locale>
#include  <memory>
#include  <cerrno>
#include  <iosfwd>
#include  <cfloat>
#include  <cstdio>
#include  <cwchar>
#include  <cmath>
#include  <ctime>
#include  <deque>
#include  <queue>
#include  <stack>
#include  <list>
#include  <ios>
#include  <map>
#include  <set>
#include  <new>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int>
using namespace std;
const string dre1="dream",dre2="dreamer";
const string ear1="erase",ear2="eraser";
const int maxn=100005;
string s;
int w[maxn],n;
void fal()
{
    cout<<"NO"<<endl;
}
bool buil()
{
    for(int i=0;i<n;i++)
    {
        if(s[i]=='d')
        {
            if(s.substr(i,7)==dre2)
            {
                if(s[i+7]=='a')
                    w[i]=i+5;
                else
                {
                    if(s[i+7]=='e')
                        w[i]=i+7;
                    else
                    {
                        cout<<"NO";
                        return 0;
                    }
                }
            }
            else
            {
                if(s.substr(i,5)==dre1)
                    w[i]=i+5;
                else
                {
                    cout<<"NO";
                    return 0;
                }
            }
        }
        else
        {
            w[i]=i+1;
        }
    }
    return 1;
}
bool ears(int x)
{
    if(s.substr(x,6)==ear2)
    {
        if(s[x+6]=='a')
            w[x]=x+5;
        else
        {
            if(s[x+6]=='e' || s[x+6]=='d')
                w[x]=x+6;
            else
            {
                fal();
                return 0;
            }
        }
    }
    else
    {
        if(s.substr(x,5)==ear1)
            w[x]=x+5;
        else
        {
            fal();
            return 0;
        }
    }
    return 1;
}
int main()
{
    cin>>s;
    n=int(s.size());
    if(!buil())
        return 0;
    for(int i=0;i<n;i=w[i])
    {
        if(w[i]!=i+1)
            continue;
        if(s[i]=='d')
        {
            fal();
            return 0;
        }
        if(!ears(i))
        {
            return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}
