import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    } main {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse(); s new StringBuilder(scanner.nextLine().trim()).reverse() new StringBuilder(scanner.nextLine().trim()).reverse new StringBuilder(scanner.nextLine().trim()) while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        } s.length() > 0 s.length() s.length s 0 {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        } if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            } s.indexOf("maerd") == 0 || s.indexOf("esare") == 0 s.indexOf("maerd") == 0 s.indexOf("maerd") s.indexOf s "maerd" 0 s.indexOf("esare") == 0 s.indexOf("esare") s.indexOf s "esare" 0 {
                s.delete(0, 5);
                continue;
            } s.delete(0, 5) s.delete s 0 5 continue; if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            } s.indexOf("resare") == 0 s.indexOf("resare") s.indexOf s "resare" 0 {
                s.delete(0, 6);
                continue;
            } s.delete(0, 6) s.delete s 0 6 continue; if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            } s.indexOf("remaerd") == 0 s.indexOf("remaerd") s.indexOf s "remaerd" 0 {
                s.delete(0, 7);
                continue;
            } s.delete(0, 7) s.delete s 0 7 continue; System.out.println("NO") System.out.println System.out System System.out "NO" System.exit(0) System.exit System 0 System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder s = new StringBuilder(scanner.nextLine().trim()).reverse();

        while (s.length() > 0) {
            if (s.indexOf("maerd") == 0 || s.indexOf("esare") == 0) {
                s.delete(0, 5);
                continue;
            }
            if (s.indexOf("resare") == 0) {
                s.delete(0, 6);
                continue;
            }
            if (s.indexOf("remaerd") == 0) {
                s.delete(0, 7);
                continue;
            }
            System.out.println("NO");
            System.exit(0);
        }
        System.out.println("YES");
    }
}