{"problem":{"name":"Just one","description":{"content":"Given is an undirected graph with $N$ vertices and $M$ edges. The vertices are called Vertex $1$, Vertex $2$, $\\ldots$, Vertex $N$, and the edges are called Edge $1$, Edge $2$, $\\ldots$, Edge $M$. Edg","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc226_e"},"statements":[{"statement_type":"Markdown","content":"Given is an undirected graph with $N$ vertices and $M$ edges. The vertices are called Vertex $1$, Vertex $2$, $\\ldots$, Vertex $N$, and the edges are called Edge $1$, Edge $2$, $\\ldots$, Edge $M$. Edge $i$ $(1 \\leq i \\leq M)$ connects Vertex $U_i$ and Vertex $V_i$. It is guaranteed that the graph is simple: it has no self-loops and no multi-edges.\nThere are $2^M$ ways to direct every edge in this graph. We want each vertex to have exactly one edge going from that vertex to another vertex. How many ways are there to direct the edges in that way? Since the answer may be enormous, print it modulo $998244353$.\n\n## Constraints\n\n*   $2 \\leq N \\leq 2\\times 10^5$\n*   $1 \\leq M \\leq 2\\times 10^5$\n*   $1 \\leq U_i,V_i \\leq N$\n*   $U_i \\neq V_i$\n*   All values in input are integers.\n*   The given graph is simple.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$U_1$ $V_1$\n$U_2$ $V_2$\n$\\vdots$\n$U_M$ $V_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc226_e","tags":[],"sample_group":[["3 3\n1 2\n1 3\n2 3","2\n\nThere are two ways to direct the edges to achieve the objective:\n\n*   $1\\rightarrow 2$ , $2\\rightarrow 3$ , $1\\leftarrow 3$\n*   $1\\leftarrow 2$ , $2\\leftarrow 3$ , $1\\rightarrow 3$"],["2 1\n1 2","0\n\nIt is obviously impossible to make every vertex have one edge going from that vertex."],["7 7\n1 2\n2 3\n3 4\n4 2\n5 6\n6 7\n7 5","4"]],"created_at":"2026-03-03 11:01:14"}}