public static void main ( String [ ] args ) {
  FastScanner sc = new FastScanner ( ) ;
  PrintWriter pw = new PrintWriter ( System . out ) ;
  String s = sc . nextLine ( ) ;
  int k = s . length ( ) ;
  while ( k > 0 ) {
    if ( k >= 5 && s . substring ( k - 5 , k ) . equals ( "dream" ) ) {
      k -= 5 ;
    }
    else if ( k >= 7 && s . substring ( k - 7 , k ) . equals ( "dreamer" ) ) {
      k -= 7 ;
    }
    else if ( k >= 5 && s . substring ( k - 5 , k ) . equals ( "erase" ) ) {
      k -= 5 ;
    }
    else if ( k >= 6 && s . substring ( k - 6 , k ) . equals ( "eraser" ) ) {
      k -= 6 ;
    }
    else {
      pw . println ( "NO" ) ;
      pw . close ( ) ;
      return ;
    }
  }
  pw . println ( "YES" ) ;
  pw . close ( ) ;
}

public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ; String s = sc . nextLine ( ) ; int k = s . length ( ) ; while ( k > 0 ) { if ( k >= 5 && s . substring ( k - 5 , k ) . equals ( " dream " ) ) { k -= 5 ; } else if ( k >= 7 && s . substring ( k - 7 , k ) . equals ( " dreamer " ) ) { k -= 7 ; } else if ( k >= 5 && s . substring ( k - 5 , k ) . equals ( " erase " ) ) { k -= 5 ; } else if ( k >= 6 && s . substring ( k - 6 , k ) . equals ( " eraser " ) ) { k -= 6 ; } else { pw . println ( " NO " ) ; pw . close ( ) ; return ; } } pw . println ( " YES " ) ; pw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (return_statement)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))