#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s;
	cin >> s;
	
	int dx = 0;
	while(dx < s.size())
	{
		string sub = s.substr(dx, 5);
		
		if(sub == "dream")
		{
			dx += 5;
			if(s[dx] == 'e' && s[dx + 1] == 'r' && s.substr(dx, 5) != "erase")
			{
				dx += 2;
			}
		}
		else if(sub == "erase")
		{
			dx += 5;
			if(s[dx] == 'r')
			{
				dx++;
			}
		}
		else
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	
	cout << "YES" << endl;
	return 0;
}