Alice has received a beautiful tree as a gift from her math teacher. This tree has nodes connected by edges, and each node is assigned a value represented by .
Alice enjoys playing with this tree by cutting certain edges and dividing it into multiple subtrees. She has a favorite number , and she's curious to find out the number of ways she can cut the tree into subtrees so that the sum of values in each subtree is divisible by . The cutting order of the edges doesn't matter.
Help Alice solve this interesting problem by determining the count of good cuttings she can make when dividing the initial tree into subtree, subtrees, subtrees, and so on, up to subtrees.
As the number of good cuttings can be huge you need to print the answer modulo .
Input format
Output format
Constraints
In the first test case -: