static String solve ( ) {
  int n = sc . nextInt ( ) ;
  int m = sc . nextInt ( ) ;
  if ( isPrime ( n ) && isPrime ( m ) ) {
    for ( int i = n + 1 ;
    i < m ;
    i ++ ) {
      if ( isPrime ( i ) ) return "NO" ;
    }
    return "YES" ;
  }
  return "NO" ;
}

static String solve ( ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; if ( isPrime ( n ) && isPrime ( m ) ) { for ( int i = n + 1 ; i < m ; i ++ ) { if ( isPrime ( i ) ) return " NO " ; } return " YES " ; } return " NO " ; }
(method_declaration (modifiers) type: (type_identifier) 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) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_statement (string_literal))))) (return_statement (string_literal)))) (return_statement (string_literal))))