#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int n, q;
inline int lowbit(int x) { return x & -x; }
struct Bitarray {
  int c[maxn];
  inline void add(int x, int v) {
    for (; x <= n; x += lowbit(x)) c[x] += v;
  }
  inline int query(int x) {
    int ans = 0;
    for (; x; x -= lowbit(x)) ans += c[x];
    return ans;
  }
  inline void add(int l, int r, int v) {
    add(l, v);
    add(r + 1, -v);
  }
} c;
int head[maxn], nxt[maxn << 1], ver[maxn << 1], tot;
inline void addedge(int a, int b) {
  nxt[++tot] = head[a];
  ver[tot] = b;
  head[a] = tot;
  nxt[++tot] = head[b];
  ver[tot] = a;
  head[b] = tot;
}
int fa[maxn][20], dep[maxn], id[maxn], id_cnt, size[maxn];
inline void dfs(int x, int fat) {
  fa[x][0] = fat;
  dep[x] = dep[fat] + 1;
  id[x] = ++id[id_cnt];
  size[x] = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (y == fat) continue;
    dfs(y, x);
    size[x] += size[y];
  }
}
inline void init() {
  scanf("%d%d", &n, &q);
  for (int i = 1, a, b; i < n; i++) scanf("%d%d", &a, &b), addedge(a, b);
  dfs(1, 0);
  for (int j = 1; j < 20; j++)
    for (int i = 1; i <= n; i++) fa[i][j] = fa[fa[i][j - 1]][j - 1];
}
inline int lca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int delta = dep[x] - dep[y], i = 0; delta; delta >>= 1, i++)
    if (delta & 1) x = fa[x][i];
  if (x == y) return x;
  for (int i = 19; i >= 0; i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return fa[x][0];
}
inline vector<int> getcnt(int rt, vector<int> v) {
  vector<int> ans;
  set<int> t;
  for (int i = 0; i < (int)v.size(); i++) t.insert(v[i]);
  for (int i = 0; i < (int)v.size(); i++)
    c.add(id[v[i]], id[v[i]] + size[v[i]] - 1, 1);
  for (int i = 0; i < (int)v.size(); i++) {
    int l = lca(v[i], rt);
    int getit = c.query(id[v[i]]) + c.query(id[rt]) - 2 * c.query(id[l]);
    if (t.count(l) == 0) getit--;
    ans.push_back(getit);
  }
  for (int i = 0; i < (int)v.size(); i++)
    c.add(id[v[i]], id[v[i]] + size[v[i]] - 1, -1);
  return ans;
}
const int mod = 1000000007;
int f[310];
inline int getans(vector<int> v, int m) {
  sort(v.begin(), v.end());
  memset(f, 0, sizeof(f));
  f[0] = 1;
  for (int i = 0; i < (int)v.size(); i++)
    for (int j = m; j >= 0; j--) {
      if (j <= v[i]) {
        f[j] = 0;
        continue;
      }
      f[j] = (1ll * f[j] * (j - v[i]) % mod + f[j - 1]) % mod;
    }
  int ans = 0;
  for (int i = 0; i <= m; i++) (ans += f[i]) %= mod;
  return ans;
}
int main() {
  init();
  while (q--) {
    int rt, m, s;
    vector<int> v;
    scanf("%d%d%d", &s, &m, &rt);
    while (s--) {
      int x;
      scanf("%d", &x);
      v.push_back(x);
    }
    printf("%d\n", getans(getcnt(rt, v), m));
  }
}
