#include <bits/stdc++.h>
using namespace std;
void dfs(int node, int pere, int l, vector<vector<int>>& adj,
         vector<vector<int>>& up, vector<int>& depth) {
  up[node][0] = pere;
  for (int i = 1; i <= l; ++i) up[node][i] = up[up[node][i - 1]][i - 1];
  for (int i : adj[node]) {
    if (i == pere) continue;
    depth[i] = depth[node] + 1;
    dfs(i, node, l, adj, up, depth);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, u, v;
  cin >> n >> m;
  int l = ceil(log2(n)) + 1;
  vector<int> depth(n + 1);
  vector<vector<int>> adj(n + 1), up(n + 1, vector<int>(l + 1));
  for (int i = 1; i < n; ++i) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  depth[1] = 1;
  dfs(1, 1, l, adj, up, depth);
  while (m--) {
    int k, a;
    cin >> k;
    vector<pair<int, int>> nodes;
    for (int i = 0; i < k; ++i) {
      cin >> a;
      a = up[a][0];
      nodes.emplace_back(depth[a], a);
    }
    sort(begin(nodes), end(nodes));
    bool ok = true;
    for (int i = 0; i < k - 1; ++i) {
      int d = nodes[i + 1].first - nodes[i].first;
      int p = nodes[i].second, q = nodes[i + 1].second;
      if (d != 0) {
        for (int j = 0; j <= l; ++j) {
          if (d & (1 << j)) q = up[q][j];
        }
      }
      if (p != q) {
        ok = false;
        break;
      }
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
