from collections import defaultdict, deque import sys input = sys.stdin.readline def inv(x): return pow(x, MOD-2, MOD) def bfs(start): queue = deque([]) queue.append(start) distance = [None] + [-1] * N distance[start] = 0 while len(queue) > 0: current_node = queue.popleft() for next_node in adj_dict[current_node]: if distance[next_node] == -1: distance[next_node] = distance[current_node] + 1 queue.append(next_node) return distance N = int(input()) MOD = 10 ** 9 + 7 fact = [1] for i in range(1, N+1): fact.append(i * fact[-1] % MOD) adj_dict = defaultdict(list) for _ in range(N-1): ui, vi = map(int, input().split()) adj_dict[ui].append(vi) adj_dict[vi].append(ui) distance = bfs(1) ans = 0 for d in distance[1:]: ans += fact[N] * inv(d+1) ans %= MOD print(ans)