#include <bits/stdc++.h>
using namespace std;
const long long p = 998244353;
const int maxm = 500010, maxn = 200010;
struct ljb {
  int firstEdge[maxn], m, n;
  struct edgeNode {
    int x, v, next;
  } edge[maxm * 2];
  ljb() { memset(this, 0, sizeof(ljb)); }
  inline void append(int op, int ed) {
    m++;
    edge[m].x = ed;
    edge[m].next = firstEdge[op];
    firstEdge[op] = m;
  }
  void dfs(int x);
} graph;
struct node {
  int fa, s;
  long long f;
  vector<int> son;
} tree[200100];
int n;
void ljb::dfs(int x) {
  tree[x].s = 1;
  for (int q = firstEdge[x]; q; q = edge[q].next) {
    int t = edge[q].x;
    if (t != tree[x].fa) {
      tree[t].fa = x;
      tree[x].son.push_back(t);
      dfs(t);
      tree[x].s += tree[t].s;
    }
  }
}
void dp(int x) {
  long long ans = 1, l = 0;
  for (auto t : tree[x].son) {
    dp(t);
    ans = ans * tree[t].f % p;
    ans = ans * (++l) % p;
  }
  if (x == 1)
    tree[x].f = ans * n % p;
  else
    tree[x].f = ans * (l + 1) % p;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i += 1) {
    int x, y;
    cin >> x >> y;
    graph.append(x, y);
    graph.append(y, x);
  }
  graph.dfs(1);
  dp(1);
  cout << tree[1].f << endl;
  return 0;
}
