public static void Cafe ( long k , long num ) {
  boolean check = false ;
  long ans = 0 ;
  long a = k ;
  if ( k == num ) {
    ans = 0 ;
    check = true ;
  }
  else {
    while ( a * k <= num ) {
      ans ++ ;
      if ( a * k == num ) {
        check = true ;
        break ;
      }
      k = a * k ;
    }
  }
  if ( check ) {
    System . out . println ( "YES" ) ;
    System . out . println ( ans ) ;
  }
  else {
    System . out . println ( "NO" ) ;
  }
}

public static void Cafe ( long k , long num ) { boolean check = false ; long ans = 0 ; long a = k ; if ( k == num ) { ans = 0 ; check = true ; } else { while ( a * k <= num ) { ans ++ ; if ( a * k == num ) { check = true ; break ; } k = a * k ; } } if ( check ) { System . out . println ( " YES " ) ; System . out . println ( ans ) ; } else { System . out . println ( " NO " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (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: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (block (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) body: (block (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true))) (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (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 (identifier))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))