import sys sys.setrecursionlimit(10**8) import pypyjit pypyjit.set_param("max_unroll_recursion=-1") mod = 10**9+7 N = int(input()) G = [list() for _ in range(N)] for i in range(N-1): u, v = map(int,input().split()) u-=1;v-=1 G[u].append(v) G[v].append(u) fac = [0]*(N+1) inv = [0]*(N+1) fac[0]=1;inv[0]=1 for i in range(1,N+1): fac[i] = (fac[i-1]*i)%mod inv[i] = (inv[i-1]*pow(i,mod-2,mod))%mod def ncr(r): return (fac[N]*inv[r]*inv[N-r])%mod res = (N*fac[N-1])%mod depth = [0]*N depth[0] = 1 def dfs(v,p): for nex in G[v]: if nex==p: continue depth[nex] = depth[v]+1 global res res += (ncr(depth[nex])*fac[depth[nex]-1]*fac[N-depth[nex]])%mod res %= mod dfs(nex,v) dfs(0,-1) print(res)