public static void sortt ( int arr [ ] , int n ) {
  int prefix [ ] = new int [ n ] ;
  prefix [ 0 ] = arr [ 0 ] ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) {
    prefix [ i ] = Math . max ( prefix [ i - 1 ] , arr [ i ] ) ;
  }
  int q = 1 ;
  int count = 1 ;
  int l = 1 , r = 1 ;
  while ( q < n ) {
    if ( prefix [ q ] == prefix [ q - 1 ] ) {
      l = q ;
      count -- ;
      while ( q < n && prefix [ q ] == prefix [ q - 1 ] ) {
        if ( arr [ q ] > arr [ q - 1 ] ) {
          System . out . println ( "no" ) ;
          return ;
        }
        else {
          q ++ ;
        }
      }
      r = q ;
    }
    else {
      q ++ ;
    }
  }
  if ( count >= 0 ) {
    if ( ( l - 2 ) >= 0 && arr [ r - 1 ] < arr [ l - 2 ] ) {
      System . out . println ( "no" ) ;
    }
    else {
      System . out . println ( "yes" ) ;
      System . out . println ( l + " " + r ) ;
    }
  }
  else {
    System . out . println ( "no" ) ;
  }
}

public static void sortt ( int arr [ ] , int n ) { int prefix [ ] = new int [ n ] ; prefix [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { prefix [ i ] = Math . max ( prefix [ i - 1 ] , arr [ i ] ) ; } int q = 1 ; int count = 1 ; int l = 1 , r = 1 ; while ( q < n ) { if ( prefix [ q ] == prefix [ q - 1 ] ) { l = q ; count -- ; while ( q < n && prefix [ q ] == prefix [ q - 1 ] ) { if ( arr [ q ] > arr [ q - 1 ] ) { System . out . println ( " no " ) ; return ; } else { q ++ ; } } r = q ; } else { q ++ ; } } if ( count >= 0 ) { if ( ( l - 2 ) >= 0 && arr [ r - 1 ] < arr [ l - 2 ] ) { System . out . println ( " no " ) ; } else { System . out . println ( " yes " ) ; System . out . println ( l + " ▁ " + r ) ; } } else { System . out . println ( " no " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) (array_access array: (identifier) index: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (update_expression (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement)) alternative: (block (expression_statement (update_expression (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (block (expression_statement (update_expression (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))