import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict from collections import deque con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) class Graph(object): def __init__(self): self.graph = defaultdict(list) def __len__(self): return len(self.graph) def add_edge(self, a, b): self.graph[a].append(b) class BFS(object): def __init__(self, graph, s, N): self.g = graph.graph self.Q = deque(); self.Q.append(s) self.dist = [INF] * N; self.dist[s] = 0 while self.Q: v = self.Q.popleft() for i in self.g[v]: if self.dist[i] == INF: self.dist[i] = self.dist[v] + 1 self.Q.append(i) class Combination(object): def __init__(self, N, con): self.fac = [0] * (N + 1) self.inv = [0] * (N + 1) self.finv = [0] * (N + 1) self.fac[0], self.fac[1] = 1, 1 self.inv[1] = 1 self.finv[0], self.finv[1] = 1, 1 # 前計算 for i in range(2, N + 1): self.fac[i] = self.fac[i - 1] * i % con self.inv[i] = self.inv[con % i] * (con - (con // i)) % con self.finv[i] = self.finv[i - 1] * self.inv[i] % con def com(self, N, k): return (self.fac[N] * self.finv[k] * self.finv[N - k]) % con #処理内容 def main(): N = int(input()) G = Graph() for i in range(N - 1): a, b = getlist() a -= 1; b -= 1 G.add_edge(a, b) G.add_edge(b, a) BF = BFS(G, 0, N) dist = BF.dist C = Combination(N, con) ans = 0 for i in range(N): ans += C.fac[N] * C.inv[dist[i] + 1] ans %= con print(ans) if __name__ == '__main__': main()