n=int(input()) mod=998244353 c=[0]*n p=1 for i in range(1,n): u,v=map(int,input().split()) c[u-1]+=1 c[v-1]+=1 p*=i p%=mod p=pow(p,-1,mod) for v in c: for i in range(v): p*=i+1 p%=mod print(p)