import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String tmpS = ""; tmpS "" while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    } !s.equals(tmpS) s.equals(tmpS) s.equals s tmpS {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    } if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      } s.endsWith("dreamer" + tmpS) s.endsWith s "dreamer" + tmpS "dreamer" tmpS {
        tmpS = "dreamer" + tmpS;
      } tmpS = "dreamer" + tmpS tmpS "dreamer" + tmpS "dreamer" tmpS if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      } s.endsWith("dream" + tmpS) s.endsWith s "dream" + tmpS "dream" tmpS {
        tmpS = "dream" + tmpS;
      } tmpS = "dream" + tmpS tmpS "dream" + tmpS "dream" tmpS if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      } s.endsWith("eraser" + tmpS) s.endsWith s "eraser" + tmpS "eraser" tmpS {
        tmpS = "eraser" + tmpS;
      } tmpS = "eraser" + tmpS tmpS "eraser" + tmpS "eraser" tmpS if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      } s.endsWith("erase" + tmpS) s.endsWith s "erase" + tmpS "erase" tmpS {
        tmpS = "erase" + tmpS;
      } tmpS = "erase" + tmpS tmpS "erase" + tmpS "erase" tmpS {
        System.out.println("NO");
        sc.close();
        return;
      } System.out.println("NO") System.out.println System.out System System.out "NO" sc.close() sc.close sc return; System.out.println("YES") System.out.println System.out System System.out "YES" sc.close() sc.close sc return; String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String tmpS = "";

    while (!s.equals(tmpS)) {
      if (s.endsWith("dreamer" + tmpS)) {
        tmpS = "dreamer" + tmpS;
      } else if (s.endsWith("dream" + tmpS)) {
        tmpS = "dream" + tmpS;
      } else if (s.endsWith("eraser" + tmpS)) {
        tmpS = "eraser" + tmpS;
      } else if (s.endsWith("erase" + tmpS)) {
        tmpS = "erase" + tmpS;
      }

      else {
        System.out.println("NO");
        sc.close();
        return;
      }
    }

    System.out.println("YES");
    sc.close();
    return;
  }
}