package main
import "fmt"
const MOD int64 = 1000000007
func main() {
  var n,x,y int
  fmt.Scan(&n)
  t := make([][]int,n)
  for i:=0;i<n-1;i++ {
    fmt.Scan(&x,&y)
    t[x-1] = append(t[x-1],y-1)
    t[y-1] = append(t[y-1],x-1)
  }
  c1,c2 := centroid(t)
  mu := NewModUtil(MOD,n)
  if c2 >= 0 { fmt.Println(mu.Pow(mu.Fact(n/2),2));return }
  s := childsize(t,c1)
  k := len(s)
  dp := make([][]int,k+1)
  for i:=0;i<k+1;i++ { dp[i] = make([]int,n) }
  dp[0][0] = 1
  m := 0
  coef := make([][]int,(n+1)/2+1)
  for i:=0;i<(n+1)/2+1;i++ {
    coef[i] = make([]int,(n+1)/2+1)
    for j:=0;j<i+1;j++ { coef[i][j] = mu.Mul(mu.Perm(i,j),mu.Comb(i,j)) }
  }
  for i:=0;i<k;i++ {
    for x:=0;x<m+1;x++ {
      for y:=0;y<s[i]+1;y++ {
        dp[i+1][x+y] = mu.Add(dp[i+1][x+y],mu.Mul(dp[i][x],coef[s[i]][y]))
      }
    }
    m += s[i]
  }
  ans := 0
  for x:=0;x<n;x++ {
    ans = mu.Add(ans,mu.Mul((1-2*(x%2))*mu.Fact(n-x),dp[k][x]))
  }
  fmt.Println(ans)
}
func centroid(t [][]int) (int,int) {
  n := len(t)
  maxsize := make([]int,n)
  var dfs func(int,int) int
  dfs = func(u,p int) int {
    s := 1
    for _,v := range t[u] {
      if v == p { continue }
      x := dfs(v,u)
      if maxsize[u] < x { maxsize[u] = x }
      s += x
    }
    if maxsize[u] < n-s { maxsize[u] = n-s }
    return s
  }
  dfs(0,-1)
  c1,c2 := -1,-1
  for i:=0;i<n;i++ {
    if maxsize[i] <= n/2 {
      if c1 < 0 { c1 = i;continue }
      if c1 >= 0 { c2 = i;break }
    }
  }
  return c1,c2
}
func childsize(t [][]int,c int) []int {
  size := []int{}
  var dfs func(int,int) int
  dfs = func(u,p int) int {
    if u == c {
      for _,v := range t[u] { size = append(size,dfs(v,u)) }
      return 0
    }
    s := 1
    for _,v := range t[u] {
      if v == p { continue }
      s += dfs(v,u)
    }
    return s
  }
  dfs(c,-1)
  return size
}
type ModUtil struct {
  mod int64
  n int
  f,g []int
}
func NewModUtil(mod int64,n int) ModUtil {
  mu := ModUtil{mod,n,make([]int,n+1),make([]int,n+1)}
  mu.f[0] = 1
  for i:=1;i<n+1;i++ { mu.f[i] = mu.Mul(mu.f[i-1],i) }
  mu.g[n] = mu.Inv(mu.f[n])
  for i:=n-1;i>-1;i-- { mu.g[i] = mu.Mul(mu.g[i+1],i+1) }
  return mu
}
func(mu ModUtil) Init(mod int64,n int) {
  if mod != mu.mod { mu = NewModUtil(mod,n);return }
  if n <= mu.n { return }
  f := make([]int,n-mu.n+1)
  g := make([]int,n-mu.n+1)
  f[0] = mu.f[mu.n]
  for i:=mu.n+1;i<n+1;i++ { f[i-mu.n] = mu.Mul(f[i-mu.n-1],i) }
  g[n-mu.n] = mu.Inv(f[n-mu.n])
  for i:=n-1;i>mu.n-1;i-- { g[i-mu.n] = mu.Mul(g[i-mu.n+1],i+1) }
  mu.f = append(mu.f,f[1:]...)
  mu.g = append(mu.g,g[1:]...)
  mu.n = n
}
func(mu ModUtil) Add(a,b int) int {
  x := int64(a)%mu.mod
  if x < 0 { x += mu.mod }
  y := int64(b)%mu.mod
  if y < 0 { y += mu.mod }
  return int((x+y)%mu.mod)
}
func(mu ModUtil) Sub(a,b int) int {
  return mu.Add(a,-b)
}
func(mu ModUtil) Mul(a,b int) int {
  x := int64(a)%mu.mod
  if x < 0 { x += mu.mod }
  y := int64(b)%mu.mod
  if y < 0 { y += mu.mod }
  return int((x*y)%mu.mod)
}
func(mu ModUtil) Div(a,b int) int {
  return mu.Mul(a,mu.Inv(b))
}
func(mu ModUtil) Inv(n int) int {
  var a,b,c,x int64 = int64(n)%mu.mod,mu.mod,0,1
  for b != 0 { a,b,c,x = b,a%b,x-(a/b)*c,c }
  x %= mu.mod
  if x < 0 { x += mu.mod }
  return int(x)
}
func(mu ModUtil) Perm(n,k int) int {
  if n < 0 || n < k { return 0 }
  if n > mu.n { mu.Init(mu.mod,n) }
  return mu.Mul(mu.f[n],mu.g[n-k])
}
func(mu ModUtil) Comb(n,k int) int {
  return mu.Mul(mu.Perm(n,k),mu.g[k])
}
func(mu ModUtil) Homo(n,k int) int {
  return mu.Comb(n+k-1,k)
}
func(mu ModUtil) Pow(n,k int) int {
  if k == 0 { return 1 }
  if k%2 == 0 {
    h := mu.Pow(n,k/2)
    return mu.Mul(h,h)
  }
  return mu.Mul(n,mu.Pow(n,k-1))
}
func(mu ModUtil) Fact(n int) int {
  if n > mu.n { mu.Init(mu.mod,n) }
  return mu.f[n]
}

Measured memory_bytes: 236800