#include <bits/stdc++.h>
using namespace std;
vector<long long> edge[100010];
pair<long long, long long> arr[100010];
long long t, in[100010], out[100010], ac[100010][20], dep[100010];
long long bit[200010];
long long dp[310];
void dfs(long long a, long long f) {
  long long i;
  ac[a][0] = f;
  for (i = 1; i < 20; i++) {
    ac[a][i] = ac[ac[a][i - 1]][i - 1];
  }
  dep[a] = dep[f] + 1;
  in[a] = ++t;
  for (long long b : edge[a]) {
    if (b == f) {
      continue;
    }
    dfs(b, a);
  }
  out[a] = ++t;
}
void add(long long a, long long x) {
  while (a <= t) {
    bit[a] += x;
    a += a & (-a);
  }
}
void aoi(long long a, long long x) {
  add(in[a], x);
  add(out[a], -x);
}
long long lca(long long a, long long b) {
  long long i;
  if (dep[a] < dep[b]) {
    swap(a, b);
  }
  for (i = 19; i >= 0; i--) {
    if (dep[ac[a][i]] >= dep[b]) {
      a = ac[a][i];
    }
  }
  for (i = 19; i >= 0; i--) {
    if (ac[a][i] != ac[b][i]) {
      a = ac[a][i];
      b = ac[b][i];
    }
  }
  return a == b ? a : ac[a][0];
}
long long sum(long long a) {
  long long res = 0;
  while (a) {
    res += bit[a];
    a -= a & (-a);
  }
  return res;
}
long long sana(long long a, long long r) {
  long long x = lca(a, r);
  return sum(in[a]) + sum(in[r]) - sum(in[x]) - sum(in[ac[x][0]]) - 1;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, q, a, b, k, m, r, i, j, ans;
  cin >> n >> q;
  for (i = 1; i < n; i++) {
    cin >> a >> b;
    edge[a].emplace_back(b);
    edge[b].emplace_back(a);
  }
  dfs(1, 0);
  while (q--) {
    cin >> k >> m >> r;
    for (i = 0; i < k; i++) {
      cin >> a;
      arr[i] = {a, a};
      aoi(a, 1);
    }
    for (i = 0; i < k; i++) {
      a = arr[i].first;
      arr[i] = {sana(a, r), a};
    }
    sort(arr, arr + k);
    for (i = 0; i <= m; i++) {
      dp[i] = !i;
    }
    for (i = 0; i < k; i++) {
      for (j = m; j; j--) {
        if (j - arr[i].first > 0) {
          dp[j] = dp[j] * (j - arr[i].first) % 1000000007;
        } else {
          dp[j] = 0;
        }
        dp[j] = (dp[j] + dp[j - 1]) % 1000000007;
      }
      dp[0] = 0;
    }
    ans = 0;
    for (i = 0; i <= m; i++) {
      ans = (ans + dp[i]) % 1000000007;
    }
    cout << ans << '\n';
    for (i = 0; i < k; i++) {
      aoi(arr[i].second, -1);
    }
  }
  return 0;
}
