N = int(input()) graph = [[] for i in range(N+1)] for i in range(N-1): u, v = map(int, input().split()) graph[u].append(v) graph[v].append(u) visited = [False for i in range(N+1)] distance = [1 for i in range(N+1)] def dfs(S): visited[S] = True for node in graph[S]: if visited[node] == False: visited[node] = True distance[node] = distance[S]+1 dfs(node) dfs(1) mod=10**9+7 power=1 for i in range(1,N+1): power*=i power%=mod def rev(X,mod): return pow(X,mod-2,mod) ans=0 for i in range(1,N+1): ans+=power*rev(distance[i],mod)%mod print(ans%mod)