#include using namespace std; typedef long long ll; typedef pair pii; typedef pair ppii; typedef pair pipi; typedef pair pll; typedef pair plpl; typedef tuple tl; ll mod=1000000007; ll inf=1000000000000000000; #define rep(i,m,n) for(int i=m;i=m;i--) ll lmax(ll a,ll b){ if(a0){ if(k%2==1){ ret*=now; ret%=mod; } now*=now; now%=mod; k/=2; } return ret; } ll gyaku(ll n){ return beki(n,mod-2); } void nckinit(ll n){ gya[0]=1; gya[1]=1; for(int i=2;i<=n;i++){ gya[i]=gya[i-1]*gyaku(i); gya[i]%=mod; } kai[0]=1; kai[1]=1; for(int i=2;i<=n;i++){ kai[i]=kai[i-1]*i; kai[i]%=mod; } } ll nck(ll n,ll k){ if(k<0)return 0; if(k==0||n==k)return 1; ll ret=kai[n]; ret*=gya[n-k]; ret%=mod; ret*=gya[k]; ret%=mod; return ret; } ll npk(ll n,ll k){ if(k<0)return 0; if(k==0)return 1; ll ret=kai[n]; ret*=gya[n-k]; ret%=mod; return ret; } int main(){ int n;cin>>n; vector v[n+1]; rep(i,0,n-1){ int a,b;cin>>a>>b; v[a].push_back(b); v[b].push_back(a); } queue q; q.push(1); queue d; d.push(1); bool used[n+1];fill(used,used+n+1,false); used[1]=true; ll ans=0; nckinit(n+1); while(q.size()>0){ int now=q.front(); ll dis=d.front(); q.pop();d.pop(); ll sum=nck(n,dis)*kai[n-dis]; sum%=mod; sum*=kai[dis-1]; sum%=mod; ans+=sum; //cout<