Find the number of subsets S of nodes in T such that the diameter of S is exactly D.
The first line of input contains a single integer n (2 ≤ n ≤ 100000).
The next n - 1 lines contains two space-separated integers each, ui, vi (1 ≤ ui ≠ vi ≤ n), describing an edge of the tree connecting ui and vi.
The last line contains a single integer D (1 ≤ D ≤ n).
It is guaranteed that the input graph is a tree.
Output a single integer, the number of subsets of nodes with diameter D. Since the answer might be large, output it modulo 109 + 7.
4 2 3 1 3 3 4 2
8
For the first sample, the subsets are {1, 2}, {1, 4}, {2, 4}, {1, 2, 3}, {1, 3, 4}, {2, 3, 4}, {1, 2, 4}, {1, 2, 3, 4}.4 2 3 1 3 3 4 1
3
For the second sample, the subsets are {1, 3}, {2, 3}, {3, 4}.
这道题你会答吗?花几分钟告诉大家答案吧!