n=int(input()) mod=998244353 g=[[] for _ in range(n)] for _ in range(n-1): u,v=map(int,input().split()) u-=1 v-=1 g[u].append(v) g[v].append(u) check=[0]*n cnt=[1]*n ans=1 dq=[0] check[0]=1 while dq: v=dq.pop() for i in g[v]: if check[i]: continue ans*=cnt[v] cnt[v]+=1 cnt[i]+=1 dq.append(i) check[i]=1 ans%=mod p=1 for i in range(1,n): p*=i p%=mod print(ans*pow(p,-1,mod)%mod)