static int product ( int A [ ] , int n ) {
  int N = 100010 ;
  int mod = 1000000007 ;
  int [ ] prime = new int [ N ] ;
  for ( int j = 0 ;
  j < N ;
  j ++ ) {
    prime [ j ] = 1 ;
  }
  prime [ 0 ] = prime [ 1 ] = 0 ;
  int i = 2 ;
  while ( i * i < N ) {
    if ( prime [ i ] == 1 ) for ( int j = 2 * i ;
    j < N ;
    j += i ) prime [ j ] = 0 ;
    i += 1 ;
  }
  int t = power ( 2 , n - 1 , mod - 1 ) ;
  int ans = 1 ;
  for ( int j = 0 ;
  j < n ;
  j ++ ) {
    i = A [ j ] ;
    if ( prime [ i ] == 1 ) {
      ans *= power ( i , t , mod ) ;
      ans %= mod ;
    }
  }
  return ans ;
}

static int product ( int A [ ] , int n ) { int N = 100010 ; int mod = 1000000007 ; int [ ] prime = new int [ N ] ; for ( int j = 0 ; j < N ; j ++ ) { prime [ j ] = 1 ; } prime [ 0 ] = prime [ 1 ] = 0 ; int i = 2 ; while ( i * i < N ) { if ( prime [ i ] == 1 ) for ( int j = 2 * i ; j < N ; j += i ) prime [ j ] = 0 ; i += 1 ; } int t = power ( 2 , n - 1 , mod - 1 ) ; int ans = 1 ; for ( int j = 0 ; j < n ; j ++ ) { i = A [ j ] ; if ( prime [ i ] == 1 ) { ans *= power ( i , t , mod ) ; ans %= mod ; } } return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (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: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (identifier)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (return_statement (identifier))))