CF1276D Tree Elimination

Description

Vasya has a tree with $ n $ vertices numbered from $ 1 $ to $ n $ , and $ n - 1 $ edges numbered from $ 1 $ to $ n - 1 $ . Initially each vertex contains a token with the number of the vertex written on it. Vasya plays a game. He considers all edges of the tree by increasing of their indices. For every edge he acts as follows: - If both endpoints of the edge contain a token, remove a token from one of the endpoints and write down its number. - Otherwise, do nothing. The result of the game is the sequence of numbers Vasya has written down. Note that there may be many possible resulting sequences depending on the choice of endpoints when tokens are removed. Vasya has played for such a long time that he thinks he exhausted all possible resulting sequences he can obtain. He wants you to verify him by computing the number of distinct sequences modulo $ 998\,244\,353 $ .

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first sample case the distinct sequences are $ (1), (2, 1), (2, 3, 1), (2, 3, 4, 1), (2, 3, 4, 5) $ . Int the second sample case the distinct sequences are $ (2, 6, 5, 3), (2, 6, 5, 7), (2, 6, 7, 2), (2, 6, 7, 5), (2, 7, 3), (2, 7, 5), (7, 1, 3), (7, 1, 5), (7, 2, 3), (7, 2, 5) $ .