def EulerTour(g, root): n = len(g) root = root g = g tank = [root] eulerTour = [] left = [0]*n right = [-1]*n depth = [-1]*n parent = [-1]*n child = [[] for i in range(n)] eulerNum = -1 de = -1 while tank: #print(tank) v = tank.pop() if v >= 0: eulerNum += 1 eulerTour.append(v) left[v] = eulerNum right[v] = eulerNum tank.append(~v) de += 1 depth[v] = de for u in g[v]: if parent[v] == u: continue tank.append(u) parent[u] = v child[v].append(u) else: de -= 1 if ~v != root: eulerTour.append(parent[~v]) eulerNum += 1 right[parent[~v]] = eulerNum return eulerTour, left, right N = 2*10**5+50 mod = 10**9+7 fac = [1]*(N+1) finv = [1]*(N+1) for i in range(N): fac[i+1] = fac[i] * (i+1) % mod finv[-1] = pow(fac[-1], mod-2, mod) for i in reversed(range(N)): finv[i] = finv[i+1] * (i+1) % mod def cmb1(n, r, mod): if r <0 or r > n: return 0 r = min(r, n-r) return fac[n] * finv[r] * finv[n-r] % mod import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline n = int(input()) edge = [[] for i in range(n)] for i in range(n-1): u, v = map(int, input().split()) u, v = u-1, v-1 edge[u].append(v) edge[v].append(u) et, left, right = EulerTour(edge, 0) p = 0 ans = 0 for i, v in enumerate(et): if i == left[v]: p += 1 ans += cmb1(n, p, mod)*fac[p-1]*fac[n-p] ans %= mod if i == right[v]: p -= 1 print(ans)