def II() -> int : return int(input()) def MI() -> int : return map(int, input().split()) def TI() -> tuple[int] : return tuple(MI()) def LI() -> list[int] : return list(MI()) #str-input def SI() -> str : return input() def MSI() -> str : return input().split() def SI_L() -> list[str] : return list(SI()) def SI_LI() -> list[int] : return list(map(int, SI())) #multiple-input def LLI(n) -> list[list[int]]: return [LI() for _ in range(n)] def LSI(n) -> list[str]: return [SI() for _ in range(n)] #1-indexを0-indexでinput def MI_1() -> int : return map(lambda x:int(x)-1, input().split()) def TI_1() -> tuple[int] : return tuple(MI_1()) def LI_1() -> list[int] : return list(MI_1()) n = II() edge = [set() for i in range(n)] for i in range(n-1): u,v = MI_1() edge[u].add(v) edge[v].add(u) mod = 998244353 class Comb: #combination列挙 def __init__(self,lim,mod = mod): """ mod : prime指定 lim以下のmodでcomdination計算 """ self.fac = [1,1] self.inv = [1,1] self.finv = [1,1] self.mod = mod for i in range(2,lim+1): self.fac.append(self.fac[i-1]*i%self.mod) self.inv.append(-self.inv[mod%i]*(mod//i)%self.mod) self.finv.append(self.finv[i-1]*self.inv[i]%self.mod) def F(self,a): return self.fac[a] def C(self,a,b): #自然な拡張 assert b >= 0, "第2引数の値が負です" if a < b: return 0 if a < 0: return 0 # 0 <= a ∧ b <= a (b < 0でバグる) return self.fac[a]*self.finv[b]*self.finv[a-b]%self.mod def P(self,a,b): assert b >= 0, "第2引数の値が負です" if a < b: return 0 if a < 0: return 0 return self.fac[a]*self.finv[a-b]%self.mod def H(self,a,b): return self.C(a+b-1,b) def Fi(self,a): return self.finv[a] comb = Comb(n) ans = comb.Fi(n-1) for i in range(n): ans *= comb.F(len(edge[i])) ans %= mod print(ans)