#include <bits/stdc++.h>
using namespace std;
constexpr int Mod = 998244353;
int n, x, y;
int gr[200005];
long long sol;
int main() {
  cin >> n;
  sol = n;
  for (int i = 1; i < n; ++i) {
    cin >> x >> y;
    gr[x]++;
    gr[y]++;
    sol = 1LL * sol * gr[x] % Mod * gr[y] % Mod;
  }
  cout << sol << '\n';
  return 0;
}
