static void exec ( Scanner in , PrintStream out ) {
  String s = in . next ( ) ;
  String t = in . next ( ) ;
  List < Character > sl = new ArrayList < > ( s . length ( ) ) ;
  for ( int i = 0 ;
  i < s . length ( ) ;
  i += 1 ) {
    sl . add ( s . charAt ( i ) ) ;
  }
  List < Character > tl = new ArrayList < > ( t . length ( ) ) ;
  for ( int i = 0 ;
  i < t . length ( ) ;
  i += 1 ) {
    tl . add ( t . charAt ( i ) ) ;
  }
  sl . sort ( null ) ;
  tl . sort ( Collections . reverseOrder ( ) ) ;
  for ( int i = 0 , n = Math . min ( sl . size ( ) , tl . size ( ) ) ;
  i < n ;
  i += 1 ) {
    if ( sl . get ( i ) . charValue ( ) < tl . get ( i ) . charValue ( ) ) {
      out . println ( "Yes" ) ;
      return ;
    }
    if ( sl . get ( i ) . charValue ( ) > tl . get ( i ) . charValue ( ) ) {
      out . println ( "No" ) ;
      return ;
    }
  }
  out . println ( s . length ( ) < t . length ( ) ? "Yes" : "No" ) ;
}

static void exec ( Scanner in , PrintStream out ) { String s = in . next ( ) ; String t = in . next ( ) ; List < Character > sl = new ArrayList < > ( s . length ( ) ) ; for ( int i = 0 ; i < s . length ( ) ; i += 1 ) { sl . add ( s . charAt ( i ) ) ; } List < Character > tl = new ArrayList < > ( t . length ( ) ) ; for ( int i = 0 ; i < t . length ( ) ; i += 1 ) { tl . add ( t . charAt ( i ) ) ; } sl . sort ( null ) ; tl . sort ( Collections . reverseOrder ( ) ) ; for ( int i = 0 , n = Math . min ( sl . size ( ) , tl . size ( ) ) ; i < n ; i += 1 ) { if ( sl . get ( i ) . charValue ( ) < tl . get ( i ) . charValue ( ) ) { out . println ( " Yes " ) ; return ; } if ( sl . get ( i ) . charValue ( ) > tl . get ( i ) . charValue ( ) ) { out . println ( " No " ) ; return ; } } out . println ( s . length ( ) < t . length ( ) ? " Yes " : " No " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (null_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) condition: (binary_expression left: (identifier) right: (identifier)) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) consequence: (string_literal) alternative: (string_literal)))))))