#include<bits/stdc++.h>
#include<cassert>
#include<numeric>

using namespace std;
typedef long long ll;
typedef long double ld;
using graph = vector<vector<int>>;
using pii = pair<int,int>;
using qd = priority_queue<int,vector<int>, greater<int>>;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repd(i,n) for(ll i=n-1;i>=0;i--)
#define F(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define sd(x) sort(x.rbegin(),x.rend())
//xにはvectorなどのコンテナ
#define all(x) (x).begin(),(x).end()
#define size(x) ((ll)(x).size())
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))

#define INF 1000000000000
#define M 10000007
#define MAXR 100000

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define FIND(x,y) find(all(x),y)!=x.end()
template<class T> inline bool chmax(T &a,T b) { if (a<b) { a=b; return true; } return false; }
template<class T> inline bool chmin(T &a,T b) { if (b<a) { a=b; return true; } return false; }

struct uf {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
    vector<int> rcount;

    uf(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }

};
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

int pow(int a, int b, int m)
{
   int ans=1;
   while(b)
   {
      if(b&1)
         ans=(ans*a)%m;
      b/=2;
      a=(a*a)%m;
   }
   return ans;
}

const int MOD = 998244353;

using mint = Fp<MOD>;


int main() {
	string s;cin>>s;
	reverse(all(s));
	string a="maerd",b="remaerd",c="esare",d="resare";
	while(size(s)!=0){
		if(s[0]==a[0]&&s[1]==a[1]&&s[2]==a[2]&&s[3]==a[3]&&s[4]==a[4])s.erase(0,5);
		else if(s[0]==b[0]&&s[1]==b[1]&&s[2]==b[2]&&s[3]==b[3]&&s[4]==b[4]&&s[5]==b[5]&&s[6]==b[6])s.erase(0,7);
		else if(s[0]==c[0]&&s[1]==c[1]&&s[2]==c[2]&&s[3]==c[3]&&s[4]==c[4])s.erase(0,5);
		else if(s[0]==d[0]&&s[1]==d[1]&&s[2]==d[2]&&s[3]==d[3]&&s[4]==d[4]&&s[5]==d[5])s.erase(0,6);
		else {cout<<"NO"<<endl;goto label;}
	}
	cout<<"YES"<<endl;
	label:;
}


Measured memory_bytes: 512