func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 rndll(chrono::steady_clock::now().time_since_epoch().count());   const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;   const int N = 2e5 + 5;   int n, q, a, b, cnt, k, par[N];   vector<int> adj[N], v;   pair<int, int> rng[N];   void dfs(int u, int p) {     par[u] = (p != -1 ? p : u);     rng[u] = {INF, -INF};     for (auto v : adj[u])       if (v != p) {         dfs(v, u);         rng[u].first = min(rng[u].first, rng[v].first);         rng[u].second = max(rng[u].second, rng[v].second);       }     if (rng[u].first == INF) cnt++, rng[u] = {cnt, cnt};   }   bool query(vector<int> &v) {     int l = -INF, r = INF;     for (auto x : v)       l = max(l, rng[par[x]].first), r = min(r, rng[par[x]].second);     return l <= r;   }   int main() {     ios_base::sync_with_stdio(0), cin.tie(0);     cin >> n >> q;     for (int i = 0; i < n - 1; i++) {       cin >> a >> b;       adj[a].push_back(b), adj[b].push_back(a);     }     dfs(1, -1);     while (q--) {       cin >> k;       v.resize(k);       for (int i = 0; i < k; i++) cin >> v[i];       cout << (query(v) ?  YES n  :  NO n );     }   }   