import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("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();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc StringBuffer str = new StringBuffer(S); str new StringBuffer(S) S = str.reverse().toString() S str.reverse().toString() str.reverse().toString str.reverse() str.reverse str int i = 0; i 0 int len = S.length(); len S.length() S.length S while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        } true {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        } if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            } len - i >= 5 && S.substring(i, i+5).equals("esare") len - i >= 5 len - i len i 5 S.substring(i, i+5).equals("esare") S.substring(i, i+5).equals S.substring(i, i+5) S.substring S i i+5 i 5 "esare" {
                //S = S.replace("esare","");
                i += 5;
            } i += 5 i 5 if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            } len - i >= 5 && S.substring(i, i+5).equals("maerd") len - i >= 5 len - i len i 5 S.substring(i, i+5).equals("maerd") S.substring(i, i+5).equals S.substring(i, i+5) S.substring S i i+5 i 5 "maerd" {
                //S = S.replace("maerd","");
                i+= 5;
            } i+= 5 i 5 if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            } len - i >= 7 && S.substring(i, i+7).equals("remaerd") len - i >= 7 len - i len i 7 S.substring(i, i+7).equals("remaerd") S.substring(i, i+7).equals S.substring(i, i+7) S.substring S i i+7 i 7 "remaerd" {
                //S = S.replace("remaerd","");
                i += 7;
            } i += 7 i 7 if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            } len - i >= 6 && S.substring(i, i+6).equals("resare") len - i >= 6 len - i len i 6 S.substring(i, i+6).equals("resare") S.substring(i, i+6).equals S.substring(i, i+6) S.substring S i i+6 i 6 "resare" {
                //S = S.replace("resare","");
                i += 6;
            } i += 6 i 6 {
                break;
            } break; if(i == len) System.out.println("YES");
        else System.out.println("NO"); i == len i len System.out.println("YES") System.out.println System.out System System.out "YES" 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) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuffer str = new StringBuffer(S);
        S = str.reverse().toString();
        int i = 0;
        int len = S.length();
        while(true) {
            if(len - i >= 5 && S.substring(i, i+5).equals("esare")) {
                //S = S.replace("esare","");
                i += 5;
            }else if(len - i >= 5 && S.substring(i, i+5).equals("maerd")) {
                //S = S.replace("maerd","");
                i+= 5;
            }else if(len - i >= 7 && S.substring(i, i+7).equals("remaerd")) {
                //S = S.replace("remaerd","");
                i += 7;
            }else if(len - i >= 6 && S.substring(i, i+6).equals("resare")) {
                //S = S.replace("resare","");
                i += 6;
            }else {
                break;
            }
        }
        if(i == len) System.out.println("YES");
        else System.out.println("NO");
    }
}