public static void solve ( ) {
  int n = f . ni ( ) ;
  char s [ ] = f . next ( ) . toCharArray ( ) ;
  int cnt = 0 ;
  boolean ok = true ;
  for ( int i = 0 ;
  i + 1 < s . length ;
  ++ i ) {
    if ( s [ i ] == '?' ) {
      ++ cnt ;
      continue ;
    }
    ok &= s [ i ] != s [ i + 1 ] ;
  }
  if ( ! ok ) {
    pn ( "No" ) ;
    return ;
  }
  if ( s [ 0 ] == '?' || s [ n - 1 ] == '?' ) {
    pn ( "Yes" ) ;
    return ;
  }
  for ( int i = 1 ;
  i + 1 < n ;
  ++ i ) {
    if ( s [ i ] == '?' && s [ i - 1 ] == s [ i + 1 ] ) {
      pn ( "Yes" ) ;
      return ;
    }
  }
  for ( int i = 0 ;
  i + 1 < n ;
  ++ i ) {
    if ( s [ i ] == '?' && s [ i + 1 ] == '?' ) {
      pn ( "Yes" ) ;
      return ;
    }
  }
  pn ( "No" ) ;
}

public static void solve ( ) { int n = f . ni ( ) ; char s [ ] = f . next ( ) . toCharArray ( ) ; int cnt = 0 ; boolean ok = true ; for ( int i = 0 ; i + 1 < s . length ; ++ i ) { if ( s [ i ] == ' ? ' ) { ++ cnt ; continue ; } ok &= s [ i ] != s [ i + 1 ] ; } if ( ! ok ) { pn ( " No " ) ; return ; } if ( s [ 0 ] == ' ? ' || s [ n - 1 ] == ' ? ' ) { pn ( " Yes " ) ; return ; } for ( int i = 1 ; i + 1 < n ; ++ i ) { if ( s [ i ] == ' ? ' && s [ i - 1 ] == s [ i + 1 ] ) { pn ( " Yes " ) ; return ; } } for ( int i = 0 ; i + 1 < n ; ++ i ) { if ( s [ i ] == ' ? ' && s [ i + 1 ] == ' ? ' ) { pn ( " Yes " ) ; return ; } } pn ( " No " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (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) dimensions: (dimensions) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) consequence: (block (expression_statement (update_expression (identifier))) (continue_statement))) (expression_statement (assignment_expression left: (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)))))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (character_literal)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal)))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_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 name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal)))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (string_literal))))))