public static void main ( String args [ ] ) {
  Scanner in ;
  PrintStream out ;
  try {
    in = new Scanner ( new FileInputStream ( "java.in" ) ) ;
    out = new PrintStream ( "java.out" ) ;
  }
  catch ( FileNotFoundException e ) {
    in = new Scanner ( new BufferedInputStream ( System . in ) ) ;
    out = System . out ;
  }
  ch [ 0 ] = Long . valueOf ( 1 ) ;
  for ( int i = 1 ;
  i < N ;
  i ++ ) {
    ch [ i ] = ( ch [ i - 1 ] * i ) % mod ;
  }
  int n = in . nextInt ( ) ;
  Long ans = Long . valueOf ( n ) ;
  for ( int i = 1 , u , v ;
  i < n ;
  i ++ ) {
    u = in . nextInt ( ) ;
    v = in . nextInt ( ) ;
    deg [ u ] ++ ;
    deg [ v ] ++ ;
  }
  for ( int i = 1 ;
  i <= n ;
  i ++ ) {
    ans = ans * ch [ deg [ i ] ] % mod ;
  }
  out . println ( ans ) ;
}

public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; try { in = new Scanner ( new FileInputStream ( " java . in " ) ) ; out = new PrintStream ( " java . out " ) ; } catch ( FileNotFoundException e ) { in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; } ch [ 0 ] = Long . valueOf ( 1 ) ; for ( int i = 1 ; i < N ; i ++ ) { ch [ i ] = ( ch [ i - 1 ] * i ) % mod ; } int n = in . nextInt ( ) ; Long ans = Long . valueOf ( n ) ; for ( int i = 1 , u , v ; i < n ; i ++ ) { u = in . nextInt ( ) ; v = in . nextInt ( ) ; deg [ u ] ++ ; deg [ v ] ++ ; } for ( int i = 1 ; i <= n ; i ++ ) { ans = ans * ch [ deg [ i ] ] % mod ; } out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (try_statement body: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal)))))) (catch_clause (catch_formal_parameter (catch_type (type_identifier)) name: (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))) right: (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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (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: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier)))) right: (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))