import java.util.*;

public class Main {
    static String str;
    static char[] c;
    static boolean ok;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    public static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    }
} import java.util.*; util.* java public class Main {
    static String str;
    static char[] c;
    static boolean ok;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    public static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    }
} Main static String str; str static char[] c; c static boolean ok; ok public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    } main {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) str = sc.next() str sc.next() sc.next sc c = str.toCharArray() c str.toCharArray() str.toCharArray str dfs(0) dfs 0 if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        } ok {
            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 static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    } dfs {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    } if (i == c.length) {
            ok = true;
            return;
        } i == c.length i c.length c c.length {
            ok = true;
            return;
        } ok = true ok true return; boolean ok5 = false; ok5 false boolean ok7 = false; ok7 false boolean ok6 = false; ok6 false if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true; i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' c[i+3] == 'a' c[i+2] == 'e' c[i+1] == 'r' i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' i+4 < c.length i+4 i 4 c.length c c.length c[i] == 'd' c[i] c i 'd' c[i+1] == 'r' c[i+1] c i+1 i 1 'r' c[i+2] == 'e' c[i+2] c i+2 i 2 'e' c[i+3] == 'a' c[i+3] c i+3 i 3 'a' c[i+4] == 'm' c[i+4] c i+4 i 4 'm' ok5 = true ok5 true if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true; i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' c[i+3] == 's' c[i+2] == 'a' c[i+1] == 'r' i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' i+4 < c.length i+4 i 4 c.length c c.length c[i] == 'e' c[i] c i 'e' c[i+1] == 'r' c[i+1] c i+1 i 1 'r' c[i+2] == 'a' c[i+2] c i+2 i 2 'a' c[i+3] == 's' c[i+3] c i+3 i 3 's' c[i+4] == 'e' c[i+4] c i+4 i 4 'e' ok5 = true ok5 true if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true; i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r' c[i+5] == 'e' c[i+4] == 'm' c[i+3] == 'a' c[i+2] == 'e' c[i+1] == 'r' i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r' i+6 < c.length i+6 i 6 c.length c c.length c[i] == 'd' c[i] c i 'd' c[i+1] == 'r' c[i+1] c i+1 i 1 'r' c[i+2] == 'e' c[i+2] c i+2 i 2 'e' c[i+3] == 'a' c[i+3] c i+3 i 3 'a' c[i+4] == 'm' c[i+4] c i+4 i 4 'm' c[i+5] == 'e' c[i+5] c i+5 i 5 'e' c[i+6] == 'r' c[i+6] c i+6 i 6 'r' ok7 = true ok7 true if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true; i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r' c[i+4] == 'e' c[i+3] == 's' c[i+2] == 'a' c[i+1] == 'r' i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r' i+5 < c.length i+5 i 5 c.length c c.length c[i] == 'e' c[i] c i 'e' c[i+1] == 'r' c[i+1] c i+1 i 1 'r' c[i+2] == 'a' c[i+2] c i+2 i 2 'a' c[i+3] == 's' c[i+3] c i+3 i 3 's' c[i+4] == 'e' c[i+4] c i+4 i 4 'e' c[i+5] == 'r' c[i+5] c i+5 i 5 'r' ok6 = true ok6 true if (ok5) {
            dfs(i + 5);
        } ok5 {
            dfs(i + 5);
        } dfs(i + 5) dfs i + 5 i 5 if (ok7) {
            dfs(i + 7);
        } ok7 {
            dfs(i + 7);
        } dfs(i + 7) dfs i + 7 i 7 if (ok6) {
            dfs(i + 6);
        } ok6 {
            dfs(i + 6);
        } dfs(i + 6) dfs i + 6 i 6 int i i public class Main {
    static String str;
    static char[] c;
    static boolean ok;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    public static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    }
} public class Main {
    static String str;
    static char[] c;
    static boolean ok;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    public static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    }
} Main
import java.util.*;

public class Main {
    static String str;
    static char[] c;
    static boolean ok;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        str = sc.next();
        c = str.toCharArray();
        
        dfs(0);
        
        if (ok) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    public static void dfs(int i) {
        // 終了条件: 最大のルンルン数は10桁なので11桁以上は不要
        if (i == c.length) {
            ok = true;
            return;
        }
        
        // System.out.println(i);
        
        boolean ok5 = false;
        boolean ok7 = false;
        boolean ok6 = false;
        
        if (i+4 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm') ok5 = true;
        if (i+4 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e') ok5 = true;
        if (i+6 < c.length && c[i] == 'd' && c[i+1] == 'r' && c[i+2] == 'e' && c[i+3] == 'a' && c[i+4] == 'm' && c[i+5] == 'e' && c[i+6] == 'r') ok7 = true;
        if (i+5 < c.length && c[i] == 'e' && c[i+1] == 'r' && c[i+2] == 'a' && c[i+3] == 's' && c[i+4] == 'e' && c[i+5] == 'r') ok6 = true;
        
        
        // 次の桁はlast-1, last+0, last+1のパターン
        if (ok5) {
            dfs(i + 5);
        }
        if (ok7) {
            dfs(i + 7);
        }
        if (ok6) {
            dfs(i + 6);
        }
    }
}