public class Main {
    public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    }
} public class Main {
    public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    }
} Main public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    } main {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    } System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO") System.out.println System.out System System.out new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO" new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+") new java.util.Scanner(System.in).next().matches new java.util.Scanner(System.in).next() new java.util.Scanner(System.in).next new java.util.Scanner(System.in) "(dream(er)?|eraser?)+" "YES" "NO" String[] args args public class Main {
    public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    }
} public class Main {
    public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    }
} Main
public class Main {
    public static void main(String[] args) {
        System.out.println(new java.util.Scanner(System.in).next().matches("(dream(er)?|eraser?)+")?"YES":"NO");
    }
}