#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rep(i,m,n) for(int i = m;i < n;++i) #define pb push_back #define fore(i,a) for(auto &i:a) #define rrep(i,m,n) for(int i = m;i >= n;--i) #define INF INT_MAX/2 using namespace std; using ll = long long; using R = double; using Data = pair>; const ll MOD = 1e9 + 7; const ll inf = 1LL << 50; struct edge { ll from; ll to; ll cost; }; typedef tupleT; typedef pairpll; int n; vectore[201010]; ll ans = 0; const int MAX = 201010; ll fac[MAX], finv[MAX], inv[MAX]; void combinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } ll comb(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } void dfs(int cu,int pa,int dpt) { ans += (((comb(n,dpt)*fac[dpt-1])%MOD)*fac[n-dpt])%MOD; ans %= MOD; fore(to, e[cu])if (to != pa)dfs(to,cu,dpt+1); } int main(){ cin >> n; combinit(); rep(i, 0, n - 1) { int a, b; cin >> a >> b; e[a].pb(b); e[b].pb(a); } dfs(1,-1,1); cout << ans%MOD << endl; return 0; }