public static void solve ( String n , String sticks ) {
  int r = Integer . parseInt ( n ) ;
  int [ ] s = Arrays . stream ( sticks . split ( " " ) ) . mapToInt ( Integer :: parseInt ) . sorted ( ) . toArray ( ) ;
  boolean helper = false ;
  boolean helper1 = false ;
  int area = s [ 0 ] * s [ 4 * r - 1 ] ;
  for ( int i = 0 ;
  i < 4 * r - 1 ;
  i = i + 2 ) {
    if ( s [ i ] == s [ i + 1 ] ) helper = true ;
    else {
      helper = false ;
      break ;
    }
  }
  if ( ! helper ) System . out . println ( "NO" ) ;
  else {
    for ( int i = 1 ;
    i < 2 * r ;
    i = i + 2 ) {
      if ( s [ i ] * s [ 4 * r - i ] == area ) helper1 = true ;
      else {
        helper1 = false ;
        break ;
      }
    }
    if ( helper1 ) System . out . println ( "YES" ) ;
    else System . out . println ( "NO" ) ;
  }
}

public static void solve ( String n , String sticks ) { int r = Integer . parseInt ( n ) ; int [ ] s = Arrays . stream ( sticks . split ( " ▁ " ) ) . mapToInt ( Integer :: parseInt ) . sorted ( ) . toArray ( ) ; boolean helper = false ; boolean helper1 = false ; int area = s [ 0 ] * s [ 4 * r - 1 ] ; for ( int i = 0 ; i < 4 * r - 1 ; i = i + 2 ) { if ( s [ i ] == s [ i + 1 ] ) helper = true ; else { helper = false ; break ; } } if ( ! helper ) System . out . println ( " NO " ) ; else { for ( int i = 1 ; i < 2 * r ; i = i + 2 ) { if ( s [ i ] * s [ 4 * r - i ] == area ) helper1 = true ; else { helper1 = false ; break ; } } if ( helper1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) name: (identifier) arguments: (argument_list (method_reference (identifier) (identifier)))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (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: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (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: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)))) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))))