#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T& x) {
  x = 0;
  T f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
  x *= f;
}
template <class T, class... Args>
void read(T& x, Args&... args) {
  read(x), read(args...);
}
template <class T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int MAXN = 2E5 + 5;
const int MOD = 1E9 + 7;
int n, m, p[MAXN][20], dep[MAXN];
vector<int> G[MAXN];
void dfs(int now, int fa) {
  dep[now] = dep[fa] + 1;
  for (auto& to : G[now]) {
    if (to == fa) continue;
    p[to][0] = now;
    dfs(to, now);
  }
}
void getP() {
  for (int j = 1; (1 << j) <= n; j++)
    for (int i = 1; i <= n; i++)
      if (p[i][j - 1]) p[i][j] = p[p[i][j - 1]][j - 1];
}
void solve() {
  int k;
  cin >> k;
  vector<int> node;
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    node.push_back(x);
  }
  auto cmp = [&](int& a, int& b) -> bool { return dep[a] > dep[b]; };
  sort(node.begin(), node.end(), cmp);
  int id = 0;
  vector<int> v;
  while (id != node.size()) {
    while (id != node.size() - 1 && dep[node[id + 1]] == dep[node[id]]) {
      if (p[node[id + 1]][0] != p[node[id]][0]) return cout << "NO\n", void();
      id++;
    }
    if (p[node[id]][0]) v.push_back(p[node[id]][0]);
    id++;
  }
  for (int i = 0; i < (int)v.size() - 1; i++) {
    int a = v[i], b = v[i + 1];
    int deltaDep = dep[a] - dep[b];
    while (dep[a] != dep[b]) {
      int j = 0;
      for (j = 0; dep[p[a][j]] >= dep[b]; j++)
        ;
      j--;
      a = p[a][j];
    }
    if (a != b) return cout << "NO\n", void();
  }
  cout << "YES\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 1), getP();
  for (int i = 1; i <= m; i++) solve();
  return 0;
}
