#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
inline int add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline int mul(int a, int b) { return (long long)a * b % mod; }
inline int qpow(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) ret = mul(ret, a);
  return ret;
}
int n;
const int N = 4e5 + 5;
int hed[N], to[N], nxt[N], cnt;
inline void adde(int u, int v) {
  ++cnt;
  to[cnt] = v, nxt[cnt] = hed[u];
  hed[u] = cnt;
}
int f[N];
int fac[N];
inline void init(int n = 4e5) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = mul(fac[i - 1], i);
}
inline void dfs(int x, int pre) {
  f[x] = 1;
  int flag = 0;
  for (int i = hed[x]; i; i = nxt[i]) {
    int v = to[i];
    if (v == pre) continue;
    ++flag;
    dfs(v, x);
    f[x] = mul(f[x], f[v]);
  }
  if (pre) {
    f[x] = mul(f[x], fac[flag + 1]);
  } else {
    f[x] = mul(f[x], fac[flag]);
  }
}
int main() {
  init();
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adde(u, v), adde(v, u);
  }
  dfs(1, 0);
  cout << mul(f[1], n) << endl;
}
