import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} import java.util.ArrayDeque; ArrayDeque java.util import java.util.Deque; Deque java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		} {
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan char[]s = new char[S.length()]; s new char[S.length()] S.length() S.length S s = S.toCharArray() s S.toCharArray() S.toCharArray S Deque<Character> que = new ArrayDeque<Character>(); que new ArrayDeque<Character>() for(int i = 0;i<s.length;i++)que.addLast(s[i]); int i = 0; int i = 0; i 0 i<s.length i s.length s s.length i++ i++ i que.addLast(s[i]); que.addLast(s[i]) que.addLast que s[i] s i while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			} true {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0;i<5;i++)sb.append(que.removeLast()); int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i sb.append(que.removeLast()); sb.append(que.removeLast()) sb.append sb que.removeLast() que.removeLast que if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			} sb.toString().equals("maerd")||sb.toString().equals("esare") sb.toString().equals("maerd") sb.toString().equals sb.toString() sb.toString sb "maerd" sb.toString().equals("esare") sb.toString().equals sb.toString() sb.toString sb "esare" {
				//sb.delete(0, 5);
			} {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			} sb.append(que.removeLast()) sb.append sb que.removeLast() que.removeLast que if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				} sb.toString().equals("resare") sb.toString().equals sb.toString() sb.toString sb "resare" {
					//sb.delete(0, 6);
				} {
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				} sb.append(que.removeLast()) sb.append sb que.removeLast() que.removeLast que if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					} sb.toString().equals("remaerd") sb.toString().equals sb.toString() sb.toString sb "remaerd" {
						//sb.delete(0, 7);
					} {
						System.out.println("NO");
						System.exit(0);
					} System.out.println("NO") System.out.println System.out System System.out "NO" System.exit(0) System.exit System 0 if(que.isEmpty())break; que.isEmpty() que.isEmpty que break; System.out.println("YES") System.out.println System.out System System.out "YES" String[]args args public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			char[]s = new char[S.length()];
			s = S.toCharArray();
			
			Deque<Character> que = new ArrayDeque<Character>();
			//Deque<String> que = new ArrayDeque<String>();
			
			for(int i = 0;i<s.length;i++)que.addLast(s[i]);
			
			//System.out.println(que.getLast());
			
			
			while(true) {
			StringBuilder sb = new StringBuilder();
			
			for(int i = 0;i<5;i++)sb.append(que.removeLast());
			
			
			if(sb.toString().equals("maerd")||sb.toString().equals("esare")) {
				//sb.delete(0, 5);
			}else {
				sb.append(que.removeLast());
				if(sb.toString().equals("resare")) {
					//sb.delete(0, 6);
				}else{
					sb.append(que.removeLast());
					if(sb.toString().equals("remaerd")) {
						//sb.delete(0, 7);
					}else {
						System.out.println("NO");
						System.exit(0);
					}
				}
			}
			
			if(que.isEmpty())break;
			}
			
			System.out.println("YES");
			
			
			
			
			
			
			
			
		}
		
		
	}
		

}
