#include <bits/stdc++.h>
using namespace std;
inline void filehandling() {}
vector<long long> vector_in(long long n) {
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  return v;
}
void vector_out(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
long long vector_sum(vector<long long> v) {
  long long sum;
  for (long long i = 0; i < v.size(); i++) sum += v[i];
  return sum;
}
vector<vector<int> > graph;
vector<long long> vectorr1;
vector<long long> vectorr2;
vector<long long> vectorr3;
long long n;
void DFSEARCH(int v1, int p) {
  int sum = 1;
  for (auto t : graph[v1]) {
    if (t != p) {
      DFSEARCH(t, v1);
      sum += vectorr2[t];
    }
  }
  vectorr2[v1] = sum;
}
void f2(int v1, int p) {
  if (graph[v1].size() == 0) {
    vectorr3[v1] = 1;
    return;
  }
  int v2 = graph[v1].size() - 1;
  if (v1 == 0) v2++;
  long long v3 = 0;
  if (v1 == 0)
    v3 = n;
  else
    v3 = v2 + 1;
  long long mul = (vectorr1[v2] * v3) % 998244353;
  for (auto t : graph[v1]) {
    if (t != p) {
      f2(t, v1);
      mul = (mul * vectorr3[t]) % 998244353;
    }
  }
  vectorr3[v1] = mul;
}
void inp(int f) {
  for (int suka = 0; suka < f - 1; suka++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  filehandling();
  cin >> n;
  vectorr1.push_back(1);
  for (int i = 1; i < n; i++) {
    vectorr1.push_back((vectorr1.back() * i) % 998244353);
  }
  vectorr2.resize(n, 0);
  vectorr3.resize(n, 0ll);
  graph.resize(n, vector<int>());
  inp(n);
  DFSEARCH(0, -1);
  f2(0, -1);
  cout << vectorr3[0] << endl;
}
