#include using namespace std; long long mod = 1e9+7; long long pow_mod(long long b, long long p, long long mod = 1'000'000'007){ long long ret = 1; while (p){ if (p & 1) ret = (ret * b) % mod; b = (b * b) % mod; p >>= 1; } return ret; } class ModuloMath{ private: long long N; long long mod; public: vector fac; vector invfac; ModuloMath(long long N, long long mod = 1'000'000'007): N{N}, mod{mod}, fac(N + 1, 1), invfac(N + 1, 1){ for (long long i = 1; i <= N; ++i) fac[i] = (fac[i - 1] * i) % mod; invfac[N] = pow_mod(fac[N], mod - 2, mod); for (long long i = N; i != 1; --i) invfac[i - 1] = (invfac[i] * i) % mod; } long long nCr(long long n, long long r){return (r > n or r < 0) ? 0 : (fac[n] * invfac[n - r] % mod * invfac[r] % mod);} long long nPr(long long n, long long r){return (r > n or r < 0) ? 0 : (fac[n] * invfac[n - r] % mod);} long long nHr(long long n, long long r){return nCr(n + r - 1, r);} }; void fill_depth(int N, const vector> &Es, vector &depth){ depth[0] = 0; vector pool = {0}; vector new_pool; int d = 0; while (pool.size() >= 1){ ++d; new_pool.clear(); for (auto p : pool){ for (auto q : Es[p]){ if (depth[q] != -1) continue; depth[q] = d; new_pool.push_back(q); } } swap(new_pool, pool); } return; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; ModuloMath mm(N + 1); vector> Es(N, vector()); for (int i = 1; i < N; ++i){ int u, v; cin >> u >> v; Es[u - 1].push_back(v - 1); Es[v - 1].push_back(u - 1); } vector depth(N, -1); fill_depth(N, Es, depth); long long f = mm.fac[N]; long long ans = 0; for (auto d : depth){ (ans += (f * pow_mod(d + 1, mod-2)) % mod) %= mod; } cout << ans << endl; return 0; }