import java.util.*;

class Main{
    static boolean dp[] = new boolean[(int)1e5+10];
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        dp[0] = true;
        for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        }

        if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO");
    }
} import java.util.*; util.* java class Main{
    static boolean dp[] = new boolean[(int)1e5+10];
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        dp[0] = true;
        for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        }

        if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO");
    }
} Main static boolean dp[] = new boolean[(int)1e5+10]; dp new boolean[(int)1e5+10] (int)1e5+10 (int)1e5 10 public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        dp[0] = true;
        for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        }

        if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO");
    } main {
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        dp[0] = true;
        for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        }

        if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO");
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in dp[0] = true dp[0] dp 0 true for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        } int i = 0 ; int i = 0 ; i 0 i < s.length i s.length s s.length i++ i++ i {
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        } {
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        } if(!dp[i])continue; !dp[i] dp[i] dp i continue; if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true; i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m' s[i+3]=='a' s[i+2]=='e' s[i+1]=='r' i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m' i+5<=s.length i+5 i 5 s.length s s.length s[i]=='d' s[i] s i 'd' s[i+1]=='r' s[i+1] s i+1 i 1 'r' s[i+2]=='e' s[i+2] s i+2 i 2 'e' s[i+3]=='a' s[i+3] s i+3 i 3 'a' s[i+4]=='m' s[i+4] s i+4 i 4 'm' dp[i+5] = true dp[i+5] dp i+5 i 5 true if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true; i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r' s[i+5]=='e' s[i+4]=='m' s[i+3]=='a' s[i+2]=='e' s[i+1]=='r' i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r' i+7<=s.length i+7 i 7 s.length s s.length s[i]=='d' s[i] s i 'd' s[i+1]=='r' s[i+1] s i+1 i 1 'r' s[i+2]=='e' s[i+2] s i+2 i 2 'e' s[i+3]=='a' s[i+3] s i+3 i 3 'a' s[i+4]=='m' s[i+4] s i+4 i 4 'm' s[i+5]=='e' s[i+5] s i+5 i 5 'e' s[i+6]=='r' s[i+6] s i+6 i 6 'r' dp[i+7] = true dp[i+7] dp i+7 i 7 true if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true; i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e' s[i+3]=='s' s[i+2]=='a' s[i+1]=='r' i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e' i+5<=s.length i+5 i 5 s.length s s.length s[i]=='e' s[i] s i 'e' s[i+1]=='r' s[i+1] s i+1 i 1 'r' s[i+2]=='a' s[i+2] s i+2 i 2 'a' s[i+3]=='s' s[i+3] s i+3 i 3 's' s[i+4]=='e' s[i+4] s i+4 i 4 'e' dp[i+5] = true dp[i+5] dp i+5 i 5 true if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true; i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r' s[i+4]=='e' s[i+3]=='s' s[i+2]=='a' s[i+1]=='r' i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r' i+6<=s.length i+6 i 6 s.length s s.length s[i]=='e' s[i] s i 'e' s[i+1]=='r' s[i+1] s i+1 i 1 'r' s[i+2]=='a' s[i+2] s i+2 i 2 'a' s[i+3]=='s' s[i+3] s i+3 i 3 's' s[i+4]=='e' s[i+4] s i+4 i 4 'e' s[i+5]=='r' s[i+5] s i+5 i 5 'r' dp[i+6] = true dp[i+6] dp i+6 i 6 true if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO"); dp[s.length] dp s.length s s.length 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
import java.util.*;

class Main{
    static boolean dp[] = new boolean[(int)1e5+10];
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        dp[0] = true;
        for(int i = 0 ; i < s.length; i++){
            if(!dp[i])continue;
            if(i+5<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m')
                dp[i+5] = true;
            if(i+7<=s.length&&s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r')
                dp[i+7] = true;
            if(i+5<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e')
                dp[i+5] = true;
            if(i+6<=s.length&&s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r')
                dp[i+6] = true;
        }

        if(dp[s.length])
            System.out.println("YES");
        else System.out.println("NO");
    }
}