#include #include #include using namespace std; using ll = long long; #include using mint = atcoder::modint998244353; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,c; cin>>n>>c; vector> g(n); for(int i = 0;i>u>>v; u--;v--; g[u].push_back(v); g[v].push_back(u); } int nni = 1; vector nipow(n+1,1),njpow(n+1,1); mint inv; vector fac(n+1,0),ifac(n+1,0); fac[0] = 1; for(int i = 1;i<=n;i++) fac[i] = fac[i-1] * i; ifac[n] = fac[n].inv(); for(int i = n-1;i>=0;i--) ifac[i] = ifac[i+1] * (i+1); auto dfs = [&](auto dfs,int ni,int p) -> mint { int all = g[ni].size(); mint sum = 1; for(auto&to:g[ni]) if(to!=p) { mint tmp = dfs(dfs,to,ni); sum *= tmp; } mint ans = nipow[all] * sum; for(int i = 1;i