#include <bits/stdc++.h>
const double esp = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int inf = 1e9;
using namespace std;
int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int mod = 998244353;
const int N = 2e5 + 10;
int n;
vector<int> grp[N];
long long fac[N];
long long f[N];
void dfs(int fa, int u) {
  f[u] = fac[grp[u].size()];
  for (int i = 0; i < grp[u].size(); i++) {
    if (grp[u][i] == fa) continue;
    dfs(u, grp[u][i]);
    f[u] = f[u] * 1ll * f[grp[u][i]] % mod;
  }
}
int main() {
  n = read();
  int x, y;
  for (int i = 0; i < n - 1; i++) {
    x = read();
    y = read();
    grp[x].push_back(y);
    grp[y].push_back(x);
  }
  fac[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = i * fac[i - 1] * 1ll % mod;
  }
  dfs(0, 1);
  cout << f[1] * n % mod << endl;
  return 0;
}
