import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    } main {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO") System.out.println System.out System System.out sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO" sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") sc.hasNext sc "((dream)|(dreamer)|(erase)|(eraser))*" "YES" "NO" String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        System.out.println(sc.hasNext("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO"); 
        
        
    }
}
