n = int(input()) e = [[] for i in range(n)] for _ in range(n-1): u,v = [int(x)-1 for x in input().split()] e[u].append(v) e[v].append(u) mod = 10**9+7 ### for bigger prime N = n+5 fact = [1]*N finv = [1]*N for i in range(2,N): fact[i] = (fact[i-1]*i)%mod finv[-1] = pow(fact[-1],mod-2,mod) for i in range(1,N)[::-1]: finv[i-1] = (finv[i]*i)%mod def nCr(n,r): if r > n: return 0 else: return fact[n]*finv[r]%mod*finv[n-r]%mod dis = [n]*n q = [0] dis[0] = 0 while q: now = q.pop() for nex in e[now]: if dis[nex] > dis[now]+1: dis[nex] = dis[now]+1 q.append(nex) ans = 0 for i in range(n): ans += nCr(n,dis[i]+1)*fact[dis[i]]*fact[n-dis[i]-1] ans %= mod print(ans)