#include #include #include #include #include #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD = 1000000007; // 998244353; const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; /*-------------------------------------------------*/ int cnt[200000] = {}; vector edge[200000]; void dfs(int ver) { for (int e : edge[ver]) if (cnt[e] == 0) { cnt[e] = cnt[ver] + 1; dfs(e); } } long long mod_inv(long long a, long long mod = MOD) { a %= mod; if (__gcd(a, mod) != 1) return -1; long long b = mod, x = 1, y = 0; while (b > 0) { long long tmp = a / b; a -= tmp * b; swap(a, b); x -= tmp * y; swap(x, y); } x %= mod; if (x < 0) x += mod; return x; } int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); int n; cin >> n; REP(i, n - 1) { int u, v; cin >> u >> v; --u; --v; edge[u].emplace_back(v); edge[v].emplace_back(u); } cnt[0] = 1; dfs(0); long long ans = 0; REP(i, n) (ans += mod_inv(cnt[i])) %= MOD; FOR(i, 1, n + 1) (ans *= i) %= MOD; cout << ans << '\n'; return 0; }