Kitty's Calculations on a Tree#11273

Kitty's Calculations on a Tree

Kitty has a tree consisting of vertices numbered from to . Her friend Alex gave her sets, each consisting of distinct vertices of the tree. For each set, Kitty needs to compute the value of the expression

\left( \sum_{\{u, v\}} u \cdot v \cdot \mathit{dist}(u, v) \right) \bmod (10^9 + 7),

where:

If a set consists of a single vertex, the sum is empty and equals .

Input

The first line contains two integers and q~(1 \le n \le 2 \cdot 10^5, 1 \le q \le 10^5) — the number of vertices in the tree and the number of sets.

Each of the next n - 1 lines contains two integers and b~(1 \le a, b \le n), describing an undirected edge between vertices and .

The next 2 \cdot q lines describe the sets, each set taking two lines:

  • the first line contains an integer k_i~(1 \le k_i \le 10^5) — the size of the -th set;

  • the second line contains k_i distinct integers — the elements of the set.

The sum of all k_i does not exceed 2 \cdot 10^5.

Output

Print lines: the -th line must contain the value of the expression for the -th set, taken modulo 10^9 + 7.

Examples

Example 1

Loading
Loading