import java.util.Scanner;

/**
 * https://abc049.contest.atcoder.jp/tasks/arc065_a
 */
public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	}

} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	} main {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc sc.close() sc.close sc String ans = "YES"; ans "YES" int i=0; i 0 while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		} i<s.length i s.length s s.length {
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		} if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			} s[i]=='e' s[i] s i 'e' {
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			} if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='r') ((++i)<s.length && s[i]=='r') (++i)<s.length (++i) i s.length s s.length s[i]=='r' s[i] s i 'r' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='a') ((++i)<s.length && s[i]=='a') (++i)<s.length (++i) i s.length s s.length s[i]=='a' s[i] s i 'a' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='s') ((++i)<s.length && s[i]=='s') (++i)<s.length (++i) i s.length s s.length s[i]=='s' s[i] s i 's' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='e') ((++i)<s.length && s[i]=='e') (++i)<s.length (++i) i s.length s s.length s[i]=='e' s[i] s i 'e' { ans = "NO"; break; } ans = "NO" ans "NO" break; if((++i)<s.length && s[i]=='r') i++; (++i)<s.length && s[i]=='r' (++i)<s.length (++i) i s.length s s.length s[i]=='r' s[i] s i 'r' i++ i if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			} s[i]=='d' s[i] s i 'd' {
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			} if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='r') ((++i)<s.length && s[i]=='r') (++i)<s.length (++i) i s.length s s.length s[i]=='r' s[i] s i 'r' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='e') ((++i)<s.length && s[i]=='e') (++i)<s.length (++i) i s.length s s.length s[i]=='e' s[i] s i 'e' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='a') ((++i)<s.length && s[i]=='a') (++i)<s.length (++i) i s.length s s.length s[i]=='a' s[i] s i 'a' { ans = "NO"; break; } ans = "NO" ans "NO" break; if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; } !((++i)<s.length && s[i]=='m') ((++i)<s.length && s[i]=='m') (++i)<s.length (++i) i s.length s s.length s[i]=='m' s[i] s i 'm' { ans = "NO"; break; } ans = "NO" ans "NO" break; if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				} (++i)<s.length &&s[i] =='e' (++i)<s.length (++i) i s.length s s.length s[i] =='e' s[i] s i 'e' {
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				} if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; } !((i+1)<s.length && s[i+1]=='r') ((i+1)<s.length && s[i+1]=='r') (i+1)<s.length (i+1) i 1 s.length s s.length s[i+1]=='r' s[i+1] s i+1 i 1 'r' { ans = "NO"; break; } ans = "NO" ans "NO" break; if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					} (i+2)>=s.length || s[i+2]!='a' (i+2)>=s.length (i+2) i 2 s.length s s.length s[i+2]!='a' s[i+2] s i+2 i 2 'a' {
						i = i+2;
					} i = i+2 i i+2 i 2 {
				ans ="NO";
				break;
			} ans ="NO" ans "NO" break; 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) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	}

} public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	}

} Main
import java.util.Scanner;

/**
 * https://abc049.contest.atcoder.jp/tasks/arc065_a
 */
public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		String ans = "YES";
		int i=0;
		while(i<s.length){
			if(s[i]=='e'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='s')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if((++i)<s.length && s[i]=='r') i++;
			}else if(s[i]=='d'){
				if(!((++i)<s.length && s[i]=='r')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='e')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='a')){ ans = "NO"; break; }
				if(!((++i)<s.length && s[i]=='m')){ ans = "NO"; break; }
				if((++i)<s.length &&s[i] =='e'){
					if(!((i+1)<s.length && s[i+1]=='r')) { ans = "NO"; break; }
					if((i+2)>=s.length || s[i+2]!='a'){
						i = i+2;
					}
				}
			}else{
				ans ="NO";
				break;
			}
		}
		System.out.println(ans);

	}

}
