
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    } main {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc String[] t = {"eraser","erase","dreamer","dream"}; t {"eraser","erase","dreamer","dream"} "eraser" "erase" "dreamer" "dream" for(int i=0;i<4;i++)s=s.replace(t[i],""); int i=0; int i=0; i 0 i<4 i 4 i++ i++ i s=s.replace(t[i],""); s=s.replace(t[i],"") s s.replace(t[i],"") s.replace s t[i] t i "" System.out.println(s.equals("")?"YES":"NO") System.out.println System.out System System.out s.equals("")?"YES":"NO" s.equals("") s.equals s "" "YES" "NO" String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    }
} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String[] t = {"eraser","erase","dreamer","dream"};
        for(int i=0;i<4;i++)s=s.replace(t[i],"");
        System.out.println(s.equals("")?"YES":"NO");
        
    }
}
