public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int t = sc . nextInt ( ) ;
  HashMap < Long , Long > map = new HashMap < Long , Long > ( ) ;
  while ( t -- > 0 ) {
    long x = sc . nextLong ( ) ;
    long d = sc . nextLong ( ) ;
    map . put ( x , d ) ;
  }
  boolean flag = false ;
  for ( Map . Entry < Long , Long > entry : map . entrySet ( ) ) {
    if ( map . containsKey ( entry . getKey ( ) + entry . getValue ( ) ) ) {
      long d = map . get ( entry . getKey ( ) + entry . getValue ( ) ) ;
      if ( entry . getKey ( ) + entry . getValue ( ) + d == entry . getKey ( ) ) {
        flag = true ;
        break ;
      }
    }
  }
  if ( flag ) {
    System . out . println ( "YES" ) ;
  }
  else {
    System . out . println ( "NO" ) ;
  }
  sc . close ( ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; HashMap < Long , Long > map = new HashMap < Long , Long > ( ) ; while ( t -- > 0 ) { long x = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; map . put ( x , d ) ; } boolean flag = false ; for ( Map . Entry < Long , Long > entry : map . entrySet ( ) ) { if ( map . containsKey ( entry . getKey ( ) + entry . getValue ( ) ) ) { long d = map . get ( entry . getKey ( ) + entry . getValue ( ) ) ; if ( entry . getKey ( ) + entry . getValue ( ) + d == entry . getKey ( ) ) { flag = true ; break ; } } } if ( flag ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } sc . close ( ) ; }
(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: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (update_expression (identifier)) right: (decimal_integer_literal))) 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)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (enhanced_for_statement type: (generic_type (scoped_type_identifier (type_identifier) (type_identifier)) (type_arguments (type_identifier) (type_identifier))) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true))) (break_statement))))))) (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))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))