MOD = 10 ** 9 + 7 N = 200200 fact = [0 for _ in range(N)] invfact = [0 for _ in range(N)] fact[0] = 1 for i in range(1, N): fact[i] = fact[i - 1] * i % MOD invfact[N - 1] = pow(fact[N - 1], MOD - 2, MOD) for i in range(N - 2, -1, -1): invfact[i] = invfact[i + 1] * (i + 1) % MOD def nCk(n, k): if k < 0 or n < k: return 0 else: return (fact[n] * invfact[k] % MOD) * invfact[n - k] % MOD def nPk(n, k): if k < 0 or n < k: return 0 else: return fact[n] * invfact[n - k] % MOD def nHk(n, k): if n == k == 0: return 1 return nCk(n + k - 1, k) n = int(input()) edges = [[] for _ in range(n)] for _ in range(n - 1): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) ans = 0 dist = [-1] * n dist[0] = 0 stack = [0] while stack: pos = stack.pop() for npos in edges[pos]: if dist[npos] == -1: dist[npos] = dist[pos] + 1 stack.append(npos) for d in dist: ans += fact[d] * invfact[d + 1] % MOD ans %= MOD ans *= fact[n] print(ans % MOD)