INF = 10 ** 9 MOD = 10 **9 + 7 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from collections import deque from math import factorial def main(): n = int(input()) G = [[] for _ in range(n)] for _ in range(n - 1): a,b = map(int,input().split()) a -= 1 b -= 1 G[a].append(b) G[b].append(a) stack = [(0,-1)] ancestors = [0] * n while stack: v,p = stack.pop() for e in G[v]: if e == p: continue ancestors[e] = ancestors[v] + 1 stack.append((e,v)) fact = factorial(n)%MOD ans = 0 for d in ancestors: ans += fact * pow(d + 1,MOD - 2,MOD) % MOD ans %= MOD print(ans) if __name__=='__main__': main()