Virus Tree 2
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given a tree with vertices and edges. The vertices are numbered from to , and the -th edge connects vertices and .
You have colors available. For each vertex in the tree, you choose one of the colors to paint it, subject to the following condition:
If the distance between two different vertices and is less than or equal to two, then and have different colors.
How many ways are there to color the tree? Find the answer modulo .
Input
The first line contains two numbers and . Each of the following lines contains two integers and .
Output
Print the number of ways to color the tree modulo .
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 128
Acceptance rate 42%