#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > v(200001);
bool visited[200001] = {false};
long long pro = 1, g = 998244353;
queue<int> q;
void bfs() {
  if (q.empty()) return;
  int p = q.front();
  int n1 = v[p].size();
  for (int i = 0; i < n1; i++) {
    if (visited[v[p][i]] == false) {
      q.push(v[p][i]);
      visited[v[p][i]] = true;
    }
  }
  for (int i = 1; i <= n1; i++) {
    pro *= i;
    pro = pro % g;
  }
  q.pop();
  bfs();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int n1 = v[1].size();
  visited[1] = true;
  for (int i = 0; i < n1; i++) {
    q.push(v[1][i]);
    visited[v[1][i]] = true;
  }
  for (int i = 1; i <= n1; i++) {
    pro *= i;
    pro = pro % g;
  }
  bfs();
  pro *= n;
  pro = pro % g;
  cout << pro;
  return 0;
}
