#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
const int maxm = 300 + 10;
vector<int> adj[maxn];
int pre[maxn], dep[maxn], sz[maxn], maxson[maxn];
void dfs1(int u, int up) {
  pre[u] = up;
  dep[u] = dep[up] + 1;
  sz[u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == up) continue;
    dfs1(v, u);
    sz[u] += sz[v];
    if (sz[v] > sz[maxson[u]]) maxson[u] = v;
  }
}
int idcnt, id[maxn], r[maxn], top[maxn];
void dfs2(int u, int up, int utop) {
  id[u] = r[u] = ++idcnt;
  top[u] = utop;
  if (maxson[u]) {
    dfs2(maxson[u], u, utop);
    r[u] = r[maxson[u]];
  }
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == up || v == maxson[u]) continue;
    dfs2(v, u, v);
    r[u] = r[v];
  }
}
struct node {
  int sum;
  node *ls, *rs;
} * root;
node* build(int l, int r) {
  static node pool[maxn * 2];
  static int pcnt = 0;
  if (l > r) return NULL;
  node* cur = pool + pcnt++;
  if (l == r) return cur;
  int mid = (l + r) >> 1;
  cur->ls = build(l, mid);
  cur->rs = build(mid + 1, r);
  return cur;
}
void update(node*& cur, int l, int r, int pos, int x) {
  cur->sum += x;
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(cur->ls, l, mid, pos, x);
  else
    update(cur->rs, mid + 1, r, pos, x);
}
int query(node* cur, int stdl, int stdr, int l, int r) {
  if (l <= stdl && stdr <= r) return cur->sum;
  int mid = (stdl + stdr) >> 1;
  int ans = 0;
  if (l <= mid) ans = query(cur->ls, stdl, mid, l, r);
  if (mid < r) ans += query(cur->rs, mid + 1, stdr, l, r);
  return ans;
}
int n;
int query(int u, int v) {
  int ans = 0;
  while (top[u] != top[v]) {
    if (dep[top[u]] > dep[top[v]]) swap(u, v);
    ans += query(root, 1, n, id[top[v]], id[v]);
    v = pre[top[v]];
  }
  if (dep[u] > dep[v]) swap(u, v);
  ans += query(root, 1, n, id[u], id[v]);
  return ans;
}
int a[maxn], b[maxn];
long long dp[maxm];
int main() {
  int q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs1(1, 1);
  dfs2(1, 1, 1);
  root = build(1, n);
  while (q--) {
    int k, m, r;
    scanf("%d%d%d", &k, &m, &r);
    for (int i = 1; i <= k; i++) {
      scanf("%d", &a[i]);
      update(root, 1, n, id[a[i]], 1);
    }
    for (int i = 1; i <= k; i++) b[i] = query(r, a[i]) - 1;
    sort(b + 1, b + 1 + k);
    memset(dp, 0, sizeof(dp));
    dp[1] = 1;
    for (int i = 2; i <= k; i++)
      for (int j = min(m, i); j >= 1; j--) {
        if (j <= b[i])
          dp[j] = 0;
        else
          dp[j] = (dp[j] * (j - b[i]) % mod + dp[j - 1]) % mod;
      }
    long long ans = 0;
    for (int i = 1; i <= m; i++) ans = (ans + dp[i]) % mod;
    printf("%lld\n", ans);
    for (int i = 1; i <= k; i++) update(root, 1, n, id[a[i]], -1);
  }
  return 0;
}
