import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner scanner.close() scanner.close scanner int sLen = s.length(); sLen s.length() s.length s boolean flag = true; flag true String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"}; w {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"} "dreameraser" "dreamerase" "dreamer" "eraser" "dream" "erase" int begin = 0; begin 0 int end = 0; end 0 while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        } flag {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        } if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            } begin == sLen begin sLen {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            } if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                } sLen == 0 sLen 0 {
                    System.out.println("NO");
                    break;
                } System.out.println("NO") System.out.println System.out System System.out "NO" break; {
                    System.out.println("YES");
                    flag = false;
                    break;
                } System.out.println("YES") System.out.println System.out System System.out "YES" flag = false flag false break; {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            } for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                } int i = 0; int i = 0; i 0 i < 7 i 7 i++ i++ i {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                } {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                } if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    } i == 6 i 6 {
                        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 end = begin + w[i].length() end begin + w[i].length() begin w[i].length() w[i].length w[i] w i if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    } end <= sLen end sLen {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    } String sub = s.substring(begin, end); sub s.substring(begin, end) s.substring s begin end if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        } sub.equals(w[i]) sub.equals sub w[i] w i {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        } begin = end begin end break; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    }
} Main
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        scanner.close();
 
        int sLen = s.length();
        boolean flag = true;
        String []w = {"dreameraser", "dreamerase", "dreamer", "eraser",
                "dream", "erase"};
        int begin = 0;
        int end = 0;
        while(flag) {
            if(begin == sLen) {
                if(sLen == 0) {
                    System.out.println("NO");
                    break;
                }else {
                    System.out.println("YES");
                    flag = false;
                    break;
                }
            }else {
                for(int i = 0; i < 7; i++) {
                    if(i == 6) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    end = begin + w[i].length();
                    //System.out.println("end " + end);
                    if(end <= sLen) {
                        String sub = s.substring(begin, end);
                        //System.out.println(sub);
                        if(sub.equals(w[i])) {
                            begin = end;
                            //System.out.println(i + " " + begin);
                            break;
                        }
                    }
                }
            }
 
        }
 
    }
}