#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

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

using mint = Mint<>;

int main() {

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

	string S;
	cin >> S;
	Int len_S = S.size();
	reverse(S.begin(), S.end());

	string dream = "dream";
	reverse(dream.begin(), dream.end());
	Int len_dream = dream.size();

	string dreamer = "dreamer";
	reverse(dreamer.begin(), dreamer.end());
	Int len_dreamer = dreamer.size();

	string erase = "erase";
	reverse(erase.begin(), erase.end());
	Int len_erase = erase.size();

	string eraser = "eraser";
	reverse(eraser.begin(), eraser.end());
	Int len_eraser = eraser.size();

	Int flag = 0;
	Int temp = 0;
	while (temp < len_S && flag==0) {
		if (temp + len_dream <= len_S && S[temp] == 'm') {
			for (Int i = 0; i < len_dream; i++) {
				if (S[temp + i] != dream[i]) {
					flag = 1;
					break;
				}
			}
			temp += len_dream;
		}
		else if(temp + len_erase <= len_S && S[temp]=='e') {
			for (Int i = 0; i < len_erase; i++) {
				if (S[temp + i] != erase[i]) {
					flag = 1;
					break;
				}
			}
			temp += len_erase;
		}
		else if (temp+len_dreamer<=len_S && S[temp] == 'r'&& S[temp+1] == 'e' && S[temp+2] == 'm') {
			for (Int i = 0; i < len_dreamer; i++) {
				if (S[temp + i] != dreamer[i]) {
					flag = 1;
					break;
				}
			}
			temp += len_dreamer;
		}
		else if (temp + len_eraser <= len_S && S[temp] == 'r' && S[temp + 1] == 'e' && S[temp + 2] == 's') {
			for (Int i = 0; i < len_eraser; i++) {
				if (S[temp + i] != eraser[i]) {
					flag = 1;
					break;
				}
			}
			temp += len_eraser;
		}
		else {
			flag = 1;
		}
    }

	cout << (flag ? "NO" : "YES") << "\n";

}

Measured memory_bytes: 512