import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(char[] str, int index) {
    if (index == str.length) return true;
    if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    }
    if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6);
    if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5);
    return false;
  }

  private static boolean compare(char[] str, int index, char[] target) {
    int i = 0;
    while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++;
    return i == target.length;
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(char[] str, int index) {
    if (index == str.length) return true;
    if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    }
    if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6);
    if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5);
    return false;
  }

  private static boolean compare(char[] str, int index, char[] target) {
    int i = 0;
    while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++;
    return i == target.length;
  }
} Main public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  } main {
    final Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } possible(s.toCharArray(), 0) possible s.toCharArray() s.toCharArray s 0 {
      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 private static boolean possible(char[] str, int index) {
    if (index == str.length) return true;
    if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    }
    if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6);
    if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5);
    return false;
  } possible {
    if (index == str.length) return true;
    if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    }
    if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6);
    if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5);
    return false;
  } if (index == str.length) return true; index == str.length index str.length str str.length return true; true if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    } compare(str, index, "dreamer".toCharArray()) compare str index "dreamer".toCharArray() "dreamer".toCharArray "dreamer" {
      return possible(str, index + 5) || possible(str, index + 7);
    } return possible(str, index + 5) || possible(str, index + 7); possible(str, index + 5) || possible(str, index + 7) possible(str, index + 5) possible str index + 5 index 5 possible(str, index + 7) possible str index + 7 index 7 if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6); compare(str, index, "eraser".toCharArray()) compare str index "eraser".toCharArray() "eraser".toCharArray "eraser" return possible(str, index + 6); possible(str, index + 6) possible str index + 6 index 6 if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5); compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray()) compare(str, index, "dream".toCharArray()) compare str index "dream".toCharArray() "dream".toCharArray "dream" compare(str, index, "erase".toCharArray()) compare str index "erase".toCharArray() "erase".toCharArray "erase" return possible(str, index + 5); possible(str, index + 5) possible str index + 5 index 5 return false; false char[] str str int index index private static boolean compare(char[] str, int index, char[] target) {
    int i = 0;
    while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++;
    return i == target.length;
  } compare {
    int i = 0;
    while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++;
    return i == target.length;
  } int i = 0; i 0 while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++; i < target.length && index + i < str.length && str[index + i] == target[i] i < target.length && index + i < str.length && str[index + i] == target[i] i < target.length i target.length target target.length index + i < str.length index + i index i str.length str str.length str[index + i] == target[i] str[index + i] str index + i index i target[i] target i i++ i return i == target.length; i == target.length i target.length target target.length char[] str str int index index char[] target target
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if (possible(s.toCharArray(), 0)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(char[] str, int index) {
    if (index == str.length) return true;
    if (compare(str, index, "dreamer".toCharArray())) {
      return possible(str, index + 5) || possible(str, index + 7);
    }
    if (compare(str, index, "eraser".toCharArray())) return possible(str, index + 6);
    if (compare(str, index, "dream".toCharArray()) || compare(str, index, "erase".toCharArray())) return possible(str, index + 5);
    return false;
  }

  private static boolean compare(char[] str, int index, char[] target) {
    int i = 0;
    while (i < target.length && index + i < str.length && str[index + i] == target[i]) i++;
    return i == target.length;
  }
}
