#arc121f. [arc121_f]Logical Operations on Tree

[arc121_f]Logical Operations on Tree

Problem Statement

Given is a tree with NN vertices numbered 11 through NN.

The ii-th edge connects Vertices aia_i and bib_i.

Snuke will label each vertex with 0 or 1 and each edge with AND or OR. Among the 22N12^{2N-1} ways to label the vertices and edges, find the number of ways that satisfy the following condition, modulo 998244353998244353.

Condition: There exists a sequence of N1N-1 operations ending up with one vertex labeled 1, where each operation consists of the steps below.

  • Choose one edge and contract it. Here, let xx and yy be the labels of the erased vertices and mathrmop\\mathrm{op} be the label of the erased edge.
  • If mathrmop\\mathrm{op} is AND, label the new vertex with mathrmAND(x,y)\\mathrm{AND}(x,y); if mathrmop\\mathrm{op} is OR, label the new vertex with mathrmOR(x,y)\\mathrm{OR}(x,y).

Notes

  • The operation mathrmAND\\mathrm{AND} is defined as follows: $\\mathrm{AND}(0,0)=(0,1)=(1,0)=0,\\mathrm{AND}(1,1)=1$.
  • The operation mathrmOR\\mathrm{OR} is defined as follows: $\\mathrm{OR}(1,1)=(0,1)=(1,0)=1,\\mathrm{OR}(0,0)=0$.
  • When contracting the edge connecting Vertex ss and Vertex tt, we merge the two vertices while removing that edge. After the contraction, there is an edge connecting the new vertex and vertex uu if and only if there was an edge connecting ss and uu or connecting tt and uu before the contraction.

Constraints

  • All values in input are integers.
  • 2leqNleq1052 \\leq N \\leq 10^{5}
  • 1leqai,bileqN1 \\leq a_i, b_i \\leq N
  • The given graph is a tree.

Input

Input is given from Standard Input in the following format:

NN a1a_1 b1b_1 vdots\\vdots aN1a_{N-1} bN1b_{N-1}

Output

Print the number of ways to label the tree that satisfy the condition in Problem Statement, modulo 998244353998244353.


Sample Input 1

2
1 2

Sample Output 1

4

Sample Input 2

20
7 3
20 18
16 12
7 2
10 5
18 16
16 3
4 11
7 15
8 1
6 1
12 13
15 5
19 17
7 1
9 8
7 17
16 14
11 7

Sample Output 2

283374562
  • Remember to print the count modulo 998244353998244353.