public static void main ( String [ ] args ) {
  Scanner scanner = new Scanner ( System . in ) ;
  int cases = scanner . nextInt ( ) ;
  while ( ( cases -- ) != 0 ) {
    int n = scanner . nextInt ( ) ;
    ArrayList < Integer > list = new ArrayList < > ( ) ;
    int temp = n * 4 ;
    while ( ( temp -- ) != 0 ) {
      list . add ( scanner . nextInt ( ) ) ;
    }
    list . sort ( Comparator . comparingInt ( o -> o ) ) ;
    boolean state = true ;
    for ( int i = 0 ;
    i < list . size ( ) - 1 ;
    i += 2 ) {
      if ( ! list . get ( i ) . equals ( list . get ( i + 1 ) ) ) {
        state = false ;
        System . out . println ( "NO" ) ;
        break ;
      }
    }
    if ( state ) {
      int lastIndex = list . size ( ) - 1 ;
      TreeSet < Integer > couple = new TreeSet < > ( ) ;
      for ( int j = 0 ;
      j < list . size ( ) / 2 ;
      j ++ ) {
        couple . add ( list . get ( j ) * list . get ( lastIndex -- ) ) ;
      }
      if ( couple . size ( ) == 1 ) {
        System . out . println ( "YES" ) ;
      }
      else {
        System . out . println ( "NO" ) ;
      }
    }
  }
}

public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int cases = scanner . nextInt ( ) ; while ( ( cases -- ) != 0 ) { int n = scanner . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < > ( ) ; int temp = n * 4 ; while ( ( temp -- ) != 0 ) { list . add ( scanner . nextInt ( ) ) ; } list . sort ( Comparator . comparingInt ( o -> o ) ) ; boolean state = true ; for ( int i = 0 ; i < list . size ( ) - 1 ; i += 2 ) { if ( ! list . get ( i ) . equals ( list . get ( i + 1 ) ) ) { state = false ; System . out . println ( " NO " ) ; break ; } } if ( state ) { int lastIndex = list . size ( ) - 1 ; TreeSet < Integer > couple = new TreeSet < > ( ) ; for ( int j = 0 ; j < list . size ( ) / 2 ; j ++ ) { couple . add ( list . get ( j ) * list . get ( lastIndex -- ) ) ; } if ( couple . size ( ) == 1 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }
(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)))) (while_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (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: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (update_expression (identifier))) right: (decimal_integer_literal))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (identifier))))))) (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: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (break_statement))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (update_expression (identifier)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) 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))))))))))))