import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Map> map = new HashMap>(); for (int i = 0; i < n - 1; i++) { int u = sc.nextInt(); int v = sc.nextInt(); List list1 = map.get(u); if (list1 == null) { list1 = new ArrayList(); map.put(u, list1); } list1.add(v); List list2 = map.get(v); if (list2 == null) { list2 = new ArrayList(); map.put(v, list2); } list2.add(u); } sc.close(); int[] dep = new int[n + 1]; Queue que = new ArrayDeque(); que.add(1); dep[1] = 1; while (!que.isEmpty()) { Integer cur = que.poll(); List list = map.get(cur); for (Integer next : list) { if (dep[next] == 0) { que.add(next); dep[next] = dep[cur] + 1; } } } int mod = 1000000007; long p = 1; for (int i = 1; i <= n; i++) { p *= i; p %= mod; } long ans = 0; for (int i = 1; i <= n; i++) { ans += p * modinv(dep[i], mod) % mod; ans %= mod; } System.out.println(ans); } static long modinv(long a, long m) { long b = m; long u = 1; long v = 0; long tmp = 0; while (b > 0) { long t = a / b; a -= t * b; tmp = a; a = b; b = tmp; u -= t * v; tmp = u; u = v; v = tmp; } u %= m; if (u < 0) u += m; return u; } }