import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { new Main().run(); } int[] depth; ArrayList[] g; long mo = (long) 1e9 + 7; long[] fac = new long[1000000]; long[] ifac = new long[1000000]; long[] inv = new long[1000000]; { fac[0] = ifac[0] = inv[0] = inv[1] = 1; for (int i = 1; i < fac.length; ++i) { fac[i] = fac[i - 1] * i % mo; } // 0 = p/m * m + p%mo // inv(m) = inv(p%m)*(p/m) for (int i = 2; i < inv.length; ++i) { inv[i] = mo - inv[(int) (mo % i)] * (mo / i) % mo; } for (int i = 1; i < ifac.length; ++i) { ifac[i] = ifac[i - 1] * inv[i] % mo; } } long pow(long a, long n) { long ret = 1; for (; n > 0; n >>= 1, a = a * a % mo) { ret = ret * a % mo; } return ret; } void dfs(int cur, int par) { for (int dst : g[cur]) { if (dst == par) { continue; } depth[dst] = depth[cur] + 1; dfs(dst, cur); } } void run() throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] u = new int[N - 1]; int[] v = new int[N - 1]; depth = new int[N]; long ans = 0; g = new ArrayList[N]; for (int i = 0; i < N; ++i) { g[i] = new ArrayList<>(); } for (int i = 0; i < N - 1; ++i) { u[i] = sc.nextInt(); v[i] = sc.nextInt(); --u[i]; --v[i]; g[u[i]].add(v[i]); g[v[i]].add(u[i]); } dfs(0, -1); ans = fac[N]; long s = 0; for (int i = 0; i < N; ++i) { s = (s + inv[depth[i] + 1]) % mo; } ans = ans * s % mo; System.out.println(ans); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }