
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String sline = sc.next(); sline sc.next() sc.next sc int n = sline.length(); n sline.length() sline.length sline sc.close() sc.close sc StringBuffer sb = new StringBuffer(sline); sb new StringBuffer(sline) String reversed = sb.reverse().toString(); reversed sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb boolean ans = true; ans true String[] words = {"maerd", "remaerd", "esare", "resare"}; words {"maerd", "remaerd", "esare", "resare"} "maerd" "remaerd" "esare" "resare" for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		} int i = 0; int i = 0; i 0 i < n i n {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		} {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		} boolean can = false; can false for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			} String w words {
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			} {
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			} int end = w.length(); end w.length() w.length w if (i + end > n) continue; i + end > n i + end i end n continue; if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				} reversed.substring(i, i + end) .equals(w) reversed.substring(i, i + end) .equals reversed.substring(i, i + end) reversed.substring reversed i i + end i end w {
					i += end;
					can = true;
				} i += end i end can = true can true if (can == false) {
				ans = false;
				break;
			} can == false can false {
				ans = false;
				break;
			} ans = false ans false break; if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} ans {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String sline = sc.next();
		int n = sline.length();
		sc.close();
		StringBuffer sb = new StringBuffer(sline);
		String reversed = sb.reverse().toString();
		
		boolean ans = true;
		String[] words = {"maerd", "remaerd", "esare", "resare"};
		for (int i = 0; i < n;) {
			boolean can = false;
			for(String w: words){
				int end = w.length();
				if (i + end > n) continue;
				if (reversed.substring(i, i + end) .equals(w)) {
					i += end;
					can = true;
				}
			}
			if (can == false) {
				ans = false;
				break;
			}
		}
		if (ans){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		
	}

}
