#include "bits/stdc++.h" using namespace std; #define Rep(i,n) for(int i=0;i<(int)(n);i++) #define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++) #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--) #define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++) #define put(a) cout< P; template inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;} template inline bool chmax(T1 &a,T2 b){if(a inline T pow(T x,U exp){ if(exp<=0){ return 1; } if(exp%2==0){ T d = pow(x,exp/2); return d*d; } else{ return (x*pow(x,exp-1)); } } template inline T fact(T n,vector& table){ if(n>=(int)table.size()){ ll s = table.size(); for(T i=s;i inline T comb(T n,T m,vector& table){//nCm if(n-m=mod){_val%=mod;} a = _val; } ModInt operator=(const ModInt n){a=n.a;return a;} ModInt operator+(const ModInt n){if((a+n.a)>=mod){return a+n.a-mod;}else{return a+n.a;}} ModInt operator-(const ModInt n){return a+(-n.a);} ModInt operator*(const ModInt n){return a*n.a;} ModInt operator/(const ModInt n){return (*this)*pow(n,mod-2);} ModInt &operator+=(const ModInt n){(*this)=(*this)+n;return *this;} ModInt &operator-=(const ModInt n){(*this)=(*this)-n;return *this;} ModInt &operator*=(const ModInt n){(*this)=(*this)*n;return *this;} ModInt &operator/=(const ModInt n){(*this)=(*this)/n;return *this;} ModInt &operator++(int){(*this)=(*this)+1;return *this;}//前置インクリメントs(++a)のオーバーロード ModInt &operator++(){(*this)=(*this)+1;return *this;}//後置インクリメント(a++)のオーバーロード ModInt &operator--(int){(*this)=(*this)-1;return *this;}//前置デクリメント(--a)のオーバーロード ModInt &operator--(){(*this)=(*this)-1;return *this;}//後置デクリメント(a--)のオーバーロード ModInt operator-(){return mod-a;}//単項-演算子(-a)のオーバーロード ModInt inv(){ModInt temp(1);return temp/(*this);}//逆数を返す関数 return (*this)/(*this)/(*this);でもいい bool operator<(const ModInt n){return a(const ModInt n){return a>n.a;} bool operator>=(const ModInt n){return a>=n.a;} bool operator==(const ModInt n){return a==n.a;} //下の関係演算子はpow関数で要請される bool operator<(const int n){return a(const int n){return a>n;} bool operator>=(const int n){return a>=n;} bool operator==(const int n){return a==n;} ModInt operator%(const int n){return a%n;} }; ostream& operator <<(ostream &o, const ModInt &t) { o << t.a; return o; } istream& operator >>(istream &i,ModInt &t) { i >> t.a; return i; } int main(){ int n; cin >> n; vector u(n); vector v(n); vector> p(n); REP(i,n-1){ cin >> u[i] >> v[i]; u[i]--; v[i]--; p[u[i]].push_back(v[i]); p[v[i]].push_back(u[i]); } vector d(n,INT_MAX); d[0] = 0; queue q; q.push(0); while(!q.empty()){ int b = q.front();q.pop(); REP(i,p[b].size()){ if(d[p[b][i]]==INT_MAX){ d[p[b][i]]=d[b]+1; q.push(p[b][i]); } } } ModInt res(0); vector table(1,1); ModInt a(n); ModInt b; REP(i,n){ b = d[i]; res += fact(a,table)/(b+1); } put(res); return 0; }