import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	} main {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	} BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); sc new BufferedReader(new InputStreamReader(System.in)) String m = ""; m "" String ans = "NO"; ans "NO" try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			m = sc.readLine();
		} m = sc.readLine() m sc.readLine() sc.readLine sc if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        } m.matches("^(dream|dreamer|erase|eraser)+$") m.matches m "^(dream|dreamer|erase|eraser)+$" {
  		    ans = "YES";
        } ans = "YES" ans "YES" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String m = "";
        String ans = "NO";
		try {
			m = sc.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (m.matches("^(dream|dreamer|erase|eraser)+$")) {
  		    ans = "YES";
        }

		System.out.println(ans);
	}
}
