#include <bits/stdc++.h>
using namespace std;
const int N = 100010, LOG = 20, M = 310;
int n, q, idx[N], r[N], dfs_cnt = 0, a, b, dp[LOG][N], k, m, root, depth[N],
                        fact[N], nck[M][M];
vector<int> g[N], arr[N], g2[N];
pair<int, int> v[N];
set<pair<int, int> > st;
set<pair<int, int> >::iterator it;
int tmp1, tmp2, cur[M], sum = 0;
void DFS(int node) {
  idx[node] = r[node] = dfs_cnt++;
  arr[node].push_back(idx[node]);
  for (int i = 0; i < (int)g[node].size(); i++) {
    if (g[node][i] == dp[0][node]) continue;
    dp[0][g[node][i]] = node;
    depth[g[node][i]] = depth[node] + 1;
    DFS(g[node][i]);
    r[node] = r[g[node][i]];
    arr[node].push_back(r[node]);
  }
}
int LCA(int u, int v) {
  if (depth[u] > depth[v]) swap(u, v);
  for (int k = LOG - 1; k >= 0; k--) {
    if (depth[u] + (1 << k) <= depth[v]) v = dp[k][v];
  }
  if (u == v) return u;
  for (int k = LOG - 1; k >= 0; k--) {
    if (dp[k][u] != dp[k][v]) u = dp[k][u], v = dp[k][v];
  }
  return dp[0][u];
}
inline int dist(int u, int v) {
  return depth[u] + depth[v] - (depth[LCA(u, v)] << 1);
}
void get(int node) {
  if (node == root) {
    it = st.begin();
    while (it != st.end()) {
      g2[node].push_back(it->second);
      it++;
    }
    st.insert(make_pair(idx[node], node));
    return;
  }
  if (idx[root] >= idx[node] && idx[root] <= r[node]) {
    tmp1 = lower_bound(arr[node].begin(), arr[node].end(), idx[root]) -
           arr[node].begin();
    tmp2 = arr[node][tmp1];
    tmp1 = arr[node][tmp1 - 1] + 1;
    it = st.begin();
    while (it != st.end() && it->first < tmp1) {
      g2[node].push_back(it->second);
      st.erase(it);
      it = st.begin();
    }
    it = st.lower_bound(make_pair(tmp2, 1000000010));
    while (it != st.end()) {
      g2[node].push_back(it->second);
      st.erase(it);
      it = st.lower_bound(make_pair(tmp2, 1000000010));
    }
  } else {
    it = st.lower_bound(make_pair(idx[node], 0));
    while (it != st.end() && it->first <= r[node]) {
      g2[node].push_back(it->second);
      st.erase(it);
      it = st.lower_bound(make_pair(idx[node], 0));
    }
  }
  st.insert(make_pair(idx[node], node));
}
int vis[N], vi = 0, ans = 1, mm;
void DFS(int node, int depth) {
  if (depth >= mm)
    ans = 0;
  else
    ans = (long long)ans * (mm - depth) % 1000000007;
  vis[node] = vi;
  for (int i = 0; i < (int)g2[node].size(); i++) DFS(g2[node][i], depth + 1);
}
int fres = 1;
inline int fastpower(int num, int po) {
  fres = 1;
  while (po > 0) {
    if (po & 1) fres = (long long)num * fres % 1000000007;
    num = (long long)num * num % 1000000007;
    po >>= 1;
  }
  return fres;
}
int main() {
  nck[0][0] = 1;
  for (int i = 1; i < M; i++) {
    nck[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      nck[i][j] = nck[i - 1][j] + nck[i - 1][j - 1];
      if (nck[i][j] >= 1000000007) nck[i][j] -= 1000000007;
    }
  }
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (long long)fact[i - 1] * i % 1000000007;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dp[0][1] = -1;
  DFS(1);
  for (int k = 1; k < LOG; k++) {
    for (int i = 1; i <= n; i++) {
      if (dp[k - 1][i] == -1)
        dp[k][i] = -1;
      else
        dp[k][i] = dp[k - 1][dp[k - 1][i]];
    }
  }
  while (q--) {
    scanf("%d%d%d", &k, &m, &root);
    st.clear();
    for (int i = 0; i < k; i++) {
      scanf("%d", &v[i].second);
      g2[v[i].second].clear();
      v[i].first = dist(v[i].second, root);
    }
    ans = 1;
    sort(v, v + k);
    for (int i = k - 1; i >= 0; i--) get(v[i].second);
    sum = 0;
    for (int j = 1; j <= m; j++) {
      mm = j;
      vi++;
      ans = 1;
      for (int i = 0; i < k; i++) {
        if (vis[v[i].second] == vi) continue;
        DFS(v[i].second, 0);
      }
      cur[j] = ans;
      for (int i = 1; i < j; i++) {
        cur[j] -= (long long)(((long long)nck[j][i] * fact[i]) % 1000000007) *
                  cur[i] % 1000000007;
        if (cur[j] < 0) cur[j] += 1000000007;
      }
      cur[j] =
          (long long)cur[j] * fastpower(fact[j], 1000000007 - 2) % 1000000007;
      sum += cur[j];
      if (sum >= 1000000007) sum -= 1000000007;
    }
    printf("%d\n", sum);
  }
  return 0;
}
