import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			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){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} main {
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} Scanner as = new Scanner(System.in); as new Scanner(System.in) String a = as.next(); a as.next() as.next as boolean b = true; b true try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		} catch(Exception e){
			b = false;
		} Exception e {
			b = false;
		} b = false b false {
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		} for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		} int i=0; int i=0; i 0 i<a.length() i a.length() a.length a i++ i++ i {
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		} {
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		} if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			} b {
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			} if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				} String.valueOf(a.charAt(i)).equals("d") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "d" {
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				} i++ i if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					} String.valueOf(a.charAt(i)).equals("r") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "r" {
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					} i++ i if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						} String.valueOf(a.charAt(i)).equals("e") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "e" {
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						} i++ i if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							} String.valueOf(a.charAt(i)).equals("a") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "a" {
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							} i++ i if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								} String.valueOf(a.charAt(i)).equals("m") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "m" {
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								} if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									} i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r") i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r") i+1<a.length() i+1 i 1 a.length() a.length a String.valueOf(a.charAt(i+1)).equals("e") String.valueOf(a.charAt(i+1)).equals String.valueOf(a.charAt(i+1)) String.valueOf String a.charAt(i+1) a.charAt a i+1 i 1 "e" String.valueOf(a.charAt(i+2)).equals("r") String.valueOf(a.charAt(i+2)).equals String.valueOf(a.charAt(i+2)) String.valueOf String a.charAt(i+2) a.charAt a i+2 i 2 "r" {
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									} if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										} i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e")) i+3<a.length() i+3 i 3 a.length() a.length a (String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e")) String.valueOf(a.charAt(i+3)).equals("d") String.valueOf(a.charAt(i+3)).equals String.valueOf(a.charAt(i+3)) String.valueOf String a.charAt(i+3) a.charAt a i+3 i 3 "d" String.valueOf(a.charAt(i+3)).equals("e") String.valueOf(a.charAt(i+3)).equals String.valueOf(a.charAt(i+3)) String.valueOf String a.charAt(i+3) a.charAt a i+3 i 3 "e" {
											i+=2;
										} i+=2 i 2 if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										} i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a") i+3<a.length() i+3 i 3 a.length() a.length a String.valueOf(a.charAt(i+3)).equals("a") String.valueOf(a.charAt(i+3)).equals String.valueOf(a.charAt(i+3)) String.valueOf String a.charAt(i+3) a.charAt a i+3 i 3 "a" {
											
										} if(i+3>=a.length()){
											i+=3;
										} i+3>=a.length() i+3 i 3 a.length() a.length a {
											i+=3;
										} i+=3 i 3 if(i+1>=a.length()){
										
									} i+1>=a.length() i+1 i 1 a.length() a.length a {
										
									} {
									b = false;
								} b = false b false {
								b = false;
							} b = false b false {
							b = false;
						} b = false b false {
						b = false;
					} b = false b false if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				} String.valueOf(a.charAt(i)).equals("e") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "e" {
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				} i++ i if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					} String.valueOf(a.charAt(i)).equals("r") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "r" {
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					} i++ i if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						} String.valueOf(a.charAt(i)).equals("a") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "a" {
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						} i++ i if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							} String.valueOf(a.charAt(i)).equals("s") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "s" {
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							} i++ i if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								} String.valueOf(a.charAt(i)).equals("e") String.valueOf(a.charAt(i)).equals String.valueOf(a.charAt(i)) String.valueOf String a.charAt(i) a.charAt a i "e" {
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								} if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									} i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r") i+1<a.length() i+1 i 1 a.length() a.length a String.valueOf(a.charAt(i+1)).equals("r") String.valueOf(a.charAt(i+1)).equals String.valueOf(a.charAt(i+1)) String.valueOf String a.charAt(i+1) a.charAt a i+1 i 1 "r" {
										i++;
									} i++ i if(i+1>=a.length()){
										
									} i+1>=a.length() i+1 i 1 a.length() a.length a {
										
									} {
									b = false;
								} b = false b false {
								b = false;
							} b = false b false {
							b = false;
						} b = false b false {
						b = false;
					} b = false b false {
					b = false;
				} b = false b false {
				break;
			} break; if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		} b {
			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){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		String a = as.next();
		boolean b = true;
		try{
		for(int i=0;i<a.length();i++){
			if(b){
				if(String.valueOf(a.charAt(i)).equals("d")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("e")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("a")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("m")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("e")
											&&String.valueOf(a.charAt(i+2)).equals("r")){
										if(i+3<a.length()&&(String.valueOf(a.charAt(i+3)).equals("d")
												||String.valueOf(a.charAt(i+3)).equals("e"))){
											i+=2;
										}else if(i+3<a.length()&&String.valueOf(a.charAt(i+3)).equals("a")){
											
										}else if(i+3>=a.length()){
											i+=3;
										}
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else if(String.valueOf(a.charAt(i)).equals("e")){
					i++;
					if(String.valueOf(a.charAt(i)).equals("r")){
						i++;
						if(String.valueOf(a.charAt(i)).equals("a")){
							i++;
							if(String.valueOf(a.charAt(i)).equals("s")){
								i++;
								if(String.valueOf(a.charAt(i)).equals("e")){
									if(i+1<a.length()&&String.valueOf(a.charAt(i+1)).equals("r")){
										i++;
									}else if(i+1>=a.length()){
										
									}
								}else{
									b = false;
								}
							}else{
								b = false;
							}
						}else{
							b = false;
						}
					}else{
						b = false;
					}
				}else{
					b = false;
				}
			}else{
				break;
			}
		}
		}catch(Exception e){
			b = false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}