#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
vector<int> E[200010];
int n;
long long c[200010], ans;
bool vis[200010];
template <typename _T>
void read(_T &x) {
  int f = 1;
  x = 0;
  char s = getchar();
  while (s > '9' || s < '0') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9')
    x = (x << 3) + (x << 1) + (s - '0'), s = getchar();
  x *= f;
}
void search(int x) {
  vis[x] = 1;
  if (E[x].size() > 1) {
    ans = ((ans % mod) * (E[x].size() % mod) % mod) *
          (c[E[x].size() - 1] % mod) % mod;
    for (auto i : E[x])
      if (!vis[i]) search(i);
  }
  return;
}
int main() {
  read(n);
  c[1] = 1;
  for (int i = 2; i <= n; i++) {
    c[i] = c[i - 1] * i % mod;
    int x, y;
    read(x), read(y);
    E[x].push_back(y), E[y].push_back(x);
  }
  vis[1] = 1;
  ans = n * c[E[1].size()];
  ans %= mod;
  for (auto i : E[1]) search(i);
  printf("%lld", ans);
  return 0;
}
