import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

} Main public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    } main {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    } try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        } {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String S = reader.readLine(); S reader.readLine() reader.readLine reader int L = S.length(); L S.length() S.length S int a = 0; a 0 while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            } true {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            } if (L - a < 5) {
                    break;
                } L - a < 5 L - a L a 5 {
                    break;
                } break; String s = S.substring(a, a + 5); s S.substring(a, a + 5) S.substring S a a + 5 a 5 if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                } s.equals("dream") s.equals s "dream" {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } a += 5 a 5 if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    } L - a >= 2 && S.subSequence(a, a + 2).equals("er") L - a >= 2 L - a L a 2 S.subSequence(a, a + 2).equals("er") S.subSequence(a, a + 2).equals S.subSequence(a, a + 2) S.subSequence S a a + 2 a 2 "er" {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    } if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        } L - a < 3 || S.charAt(a + 2) != 'a' L - a < 3 L - a L a 3 S.charAt(a + 2) != 'a' S.charAt(a + 2) S.charAt S a + 2 a 2 'a' {
                            a += 2;
                        } a += 2 a 2 if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                } s.equals("erase") s.equals s "erase" {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } a += 5 a 5 if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    } L - a >= 1 && S.charAt(a) == 'r' L - a >= 1 L - a L a 1 S.charAt(a) == 'r' S.charAt(a) S.charAt S a 'r' {
                        a += 1;
                    } a += 1 a 1 {
                    break;
                } break; if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            } a == L a L {
                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) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            String S = reader.readLine();
            int L = S.length();

            int a = 0;
            while (true) {
                if (L - a < 5) {
                    break;
                }

                String s = S.substring(a, a + 5);

                if (s.equals("dream")) {
                    a += 5;
                    if (L - a >= 2 && S.subSequence(a, a + 2).equals("er")) {
                        if (L - a < 3 || S.charAt(a + 2) != 'a') {
                            a += 2;
                        }
                    }
                } else if (s.equals("erase")) {
                    a += 5;
                    if (L - a >= 1 && S.charAt(a) == 'r') {
                        a += 1;
                    }
                } else {
                    break;
                }
            }

            if (a == L) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

}
