#include <bits/stdc++.h>
using namespace std;
int n;
long long fac[200005];
vector<int> g[200005];
long long dfs(int u, int p) {
  int adj = g[u].size() - (p != -1);
  long long x = u == 0 ? 1 : adj + 1;
  long long ans = (fac[adj] * x) % 998244353LL;
  for (int v : g[u]) {
    if (v != p) {
      ans = (ans * dfs(v, u)) % 998244353LL;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  fac[0] = 1;
  for (int i = 1; i < 200005; ++i) {
    fac[i] = (fac[i - 1] * i) % 998244353LL;
  }
  cin >> n;
  for (int i = 0, u, v; i < n - 1; ++i) {
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
  cout << (n * dfs(0, -1)) % 998244353LL << "\n";
}
