public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int num = sc . nextInt ( ) ;
  int first = sc . nextInt ( ) ;
  int last = sc . nextInt ( ) ;
  boolean bit [ ] = new boolean [ num ] ;
  int index [ ] = new int [ num ] ;
  int sum = 0 ;
  for ( int i = 0 ;
  i < num ;
  i ++ ) {
    bit [ i ] = ( first & ( 1 << i ) ) != ( last & ( 1 << i ) ) ;
    sum += bit [ i ] ? 1 : 0 ;
    index [ bit [ i ] ? sum - 1 : num - ( i - sum ) - 1 ] = i ;
  }
  if ( sum % 2 == 0 ) {
    System . out . println ( "NO" ) ;
  }
  else {
    System . out . println ( "YES" ) ;
    int max = ( int ) Math . pow ( 2 , num ) ;
    int tmp = first ;
    int change [ ] = new int [ num ] ;
    System . out . print ( tmp + " " ) ;
    for ( int i = 1 ;
    i < max ;
    i ++ ) {
      int crtIndex = 0 ;
      for ( ;
      crtIndex < num ;
      crtIndex ++ ) {
        if ( ( i & ( 1 << crtIndex ) ) != 0 ) {
          break ;
        }
      }
      crtIndex = num - crtIndex - 1 ;
      if ( bit [ index [ crtIndex ] ] && crtIndex != 0 ) {
        if ( crtIndex % 2 == 0 ) {
          if ( change [ crtIndex ] < 2 ) {
            change [ crtIndex ] ++ ;
            crtIndex -- ;
          }
        }
        else {
          if ( change [ crtIndex ] < 1 ) {
            change [ crtIndex ] ++ ;
            crtIndex ++ ;
          }
        }
      }
      int crtDigit = 1 << index [ crtIndex ] ;
      tmp = ( tmp & crtDigit ) != 0 ? tmp - crtDigit : tmp + crtDigit ;
      System . out . print ( tmp + " " ) ;
    }
  }
  System . out . println ( ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int first = sc . nextInt ( ) ; int last = sc . nextInt ( ) ; boolean bit [ ] = new boolean [ num ] ; int index [ ] = new int [ num ] ; int sum = 0 ; for ( int i = 0 ; i < num ; i ++ ) { bit [ i ] = ( first & ( 1 << i ) ) != ( last & ( 1 << i ) ) ; sum += bit [ i ] ? 1 : 0 ; index [ bit [ i ] ? sum - 1 : num - ( i - sum ) - 1 ] = i ; } if ( sum % 2 == 0 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; int max = ( int ) Math . pow ( 2 , num ) ; int tmp = first ; int change [ ] = new int [ num ] ; System . out . print ( tmp + " ▁ " ) ; for ( int i = 1 ; i < max ; i ++ ) { int crtIndex = 0 ; for ( ; crtIndex < num ; crtIndex ++ ) { if ( ( i & ( 1 << crtIndex ) ) != 0 ) { break ; } } crtIndex = num - crtIndex - 1 ; if ( bit [ index [ crtIndex ] ] && crtIndex != 0 ) { if ( crtIndex % 2 == 0 ) { if ( change [ crtIndex ] < 2 ) { change [ crtIndex ] ++ ; crtIndex -- ; } } else { if ( change [ crtIndex ] < 1 ) { change [ crtIndex ] ++ ; crtIndex ++ ; } } } int crtDigit = 1 << index [ crtIndex ] ; tmp = ( tmp & crtDigit ) != 0 ? tmp - crtDigit : tmp + crtDigit ; System . out . print ( tmp + " ▁ " ) ; } } System . out . println ( ) ; }
(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 (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) 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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))))) right: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (ternary_expression condition: (array_access array: (identifier) index: (identifier)) consequence: (decimal_integer_literal) alternative: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (ternary_expression condition: (array_access array: (identifier) index: (identifier)) consequence: (binary_expression left: (identifier) right: (decimal_integer_literal)) alternative: (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (decimal_integer_literal)))) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) 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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (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 (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))))) right: (decimal_integer_literal))) consequence: (block (break_statement))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier)))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (ternary_expression condition: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)) consequence: (binary_expression left: (identifier) right: (identifier)) alternative: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))))