N = int(input()) prime = 10**9 + 7 f = [1] * (N + 1) for i in range(1, N + 1): f[i] = i * f[i-1] % prime f[0] =f[N] def inv(x,prime): _x = x inv = 1 k = prime -2 while k > 0: if k % 2 == 1: inv = (inv * _x) % prime _x = (_x * _x) % prime k = int(k /2) return inv for i in range(1,N+1): f[i] = f[0] * inv(i, prime) % prime a = [0] * (N + 1) flag = [False] * (N+1) edge = [[] for _ in range(N + 1)] for _ in range(N-1): e = list(map(int, input().split())) edge[e[0]].append(e[1]) edge[e[1]].append(e[0]) q = [1] a[1] = 1 while len(q) > 0: v = q.pop() flag[v] = True for child in edge[v]: if flag[child] == False: q.append(child) a[child] = a[v] + 1 print(int(sum([f[a[i]] for i in range(1, N+1)])) % prime)