#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[200005];
bool visited[200005] = {0};
long long dfs(long long x, long long p) {
  visited[x] = true;
  long long ans = 1, f = 1;
  for (auto y : adj[x]) {
    if (!visited[y]) {
      p++;
      ans = (ans * dfs(y, 1)) % 998244353;
      f = (f * p) % 998244353;
    }
  }
  return (f * ans) % 998244353;
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  cout << (n * dfs(1, 0)) % 998244353;
  return 0;
}
