Busy Beaver is causing chaos at the farmers' market again! This time, he is starting a food fight among the stalls.
The stalls are numbered from $$$1$$$ to $$$N$$$ and are connected by $$$N-1$$$ roads, forming a tree. In other words, it is possible to travel from any stall to any other stall by following the roads, and there is exactly one simple path between any two stalls.
Busy Beaver assigns each stall to either Team Potato or Team Tomato as follows:
Your task is to count the number of possible team assignments. Note that different minimum-length routes may produce the same final assignment; such assignments should be counted only once. Since the answer may be enormous, output it modulo $$$10^9+7$$$.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$) — the number of test cases.
The first line of each test case contains a single integer $$$N$$$ ($$$2 \le N \le 10^5$$$).
Each of the next $$$N-1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u, v \le N$$$, $$$u \neq v$$$), indicating that there is a road between stalls $$$u$$$ and $$$v$$$.
The sum of $$$N$$$ across all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output a single integer: the number of possible final team assignments modulo $$$10^9+7$$$.
There are two subtasks for this problem.
441 22 32 471 21 31 41 51 61 771 21 32 42 53 63 771 21 31 42 52 62 7
220812
The sample contains $$$4$$$ test cases:
In the first test case, one possible team assignment is shown below.
One minimum-length route is: $$$$$$ 1 \to 2 \to 3 \to 2 \to 4 \to 2 \to 1. $$$$$$
Its total length is $$$6$$$, which is the smallest possible for a route that starts at stall $$$1$$$, visits every stall, and returns to stall $$$1$$$.
The stalls are then assigned in the order in which they are first visited:
The other possible team assignment is obtained by visiting stall $$$4$$$ before stall $$$3$$$, which swaps their teams. Therefore, the total number of possible team assignments is $$$2$$$.
| Название |
|---|


