#include <iostream>
#include <bits/stdc++.h>
#define int long long
using namespace std;
void parental(int parent[],vector<bool>&visited,int start)
{
if(start==0)
{ visited[0]=true;
return;
}
visited[start]=true;
parental(parent,visited,parent[start]);
}
int32_t main()
{
int n,q;
cin>>n>>q;
set<int>adj[n];
for(int i=0;i<(n-1);i++)
{
int a,b;
cin>>a>>b;
adj[a-1].insert(b-1);
adj[b-1].insert(a-1);
}
int parent[n];
parent[0]=0;
for(int i=1;i<n;i++)
{
parent[i]= *adj[i].begin();
}
vector<int>querys[q];
for(int i=0;i<q;i++)
{
int k;
cin>>k;
for(int j=0;j<k;j++)
{
int y;
cin>>y;
querys[i].push_back(y-1);
}
}
for(int i=0;i<q;i++)
{ int maxi=0;
for(int j=0;j<querys[i].size();j++)
{
if(querys[i][j]>maxi)
{
maxi = querys[i][j];
}
}
vector<bool>visited(n,false);
parental(parent,visited,maxi);
int flag=0;
for(int j=0;j<querys[i].size();j++)
{
if(!visited[parent[querys[i][j]]] )
{
flag=1;
break;
}
}
if(flag==1)
{
cout<<"NO";
}
else
{
cout<<"YES";
}
cout<<"\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBpbnQgbG9uZyBsb25nIAp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCiAKdm9pZCBwYXJlbnRhbChpbnQgcGFyZW50W10sdmVjdG9yPGJvb2w+JnZpc2l0ZWQsaW50IHN0YXJ0KQp7CiAgICBpZihzdGFydD09MCkKICAgIHsgICB2aXNpdGVkWzBdPXRydWU7CiAgICAgICAgcmV0dXJuOwogICAgfQogICAgdmlzaXRlZFtzdGFydF09dHJ1ZTsKIAogICAgcGFyZW50YWwocGFyZW50LHZpc2l0ZWQscGFyZW50W3N0YXJ0XSk7Cn0KIAppbnQzMl90IG1haW4oKQp7CiAKICAgIGludCBuLHE7CiAgICBjaW4+Pm4+PnE7CiAgICBzZXQ8aW50PmFkaltuXTsKICAgIGZvcihpbnQgaT0wO2k8KG4tMSk7aSsrKQogICAgewogICAgICAgIGludCBhLGI7CiAgICAgICAgY2luPj5hPj5iOwogICAgICAgIGFkalthLTFdLmluc2VydChiLTEpOwogICAgICAgIGFkaltiLTFdLmluc2VydChhLTEpOwogICAgfQogICAgaW50IHBhcmVudFtuXTsKICAgIHBhcmVudFswXT0wOwogICAgZm9yKGludCBpPTE7aTxuO2krKykKICAgIHsKICAgICAgICBwYXJlbnRbaV09ICphZGpbaV0uYmVnaW4oKTsKIAogICAgfQogCiAgICAgICAgdmVjdG9yPGludD5xdWVyeXNbcV07CiAgICAgICAgZm9yKGludCBpPTA7aTxxO2krKykKICAgICAgICB7CiAgICAgICAgICAgIGludCBrOwogICAgICAgICAgICBjaW4+Pms7CiAgICAgICAgICAgIGZvcihpbnQgaj0wO2o8aztqKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGludCB5OwogICAgICAgICAgICAgICAgY2luPj55OwogICAgICAgICAgICAgICAgcXVlcnlzW2ldLnB1c2hfYmFjayh5LTEpOwogICAgICAgICAgICB9CiAgICAgICAgfQogCiAgICAgICBmb3IoaW50IGk9MDtpPHE7aSsrKQogICAgICAgeyAgIGludCBtYXhpPTA7CiAgICAgICAgICAgZm9yKGludCBqPTA7ajxxdWVyeXNbaV0uc2l6ZSgpO2orKykKICAgICAgICAgICB7CiAgICAgICAgICAgICAgIGlmKHF1ZXJ5c1tpXVtqXT5tYXhpKQogICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgbWF4aSA9IHF1ZXJ5c1tpXVtqXTsKIAogICAgICAgICAgICAgICB9CiAgICAgICAgICAgfQogICAgICAgIHZlY3Rvcjxib29sPnZpc2l0ZWQobixmYWxzZSk7CiAKICAgICAgICBwYXJlbnRhbChwYXJlbnQsdmlzaXRlZCxtYXhpKTsKICAgICAgICBpbnQgZmxhZz0wOwogCiAKICAgICAgICBmb3IoaW50IGo9MDtqPHF1ZXJ5c1tpXS5zaXplKCk7aisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoIXZpc2l0ZWRbcGFyZW50W3F1ZXJ5c1tpXVtqXV1dICApCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGZsYWc9MTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAKICAgICAgICB9CiAgICAgICAgaWYoZmxhZz09MSkKICAgICAgICB7CiAgICAgICAgICAgIGNvdXQ8PCJOTyI7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAKICAgICAgICAgICAgY291dDw8IllFUyI7CiAgICAgICAgfQogICAgICAgIGNvdXQ8PCJcbiI7CiAgICAgICB9CiAKIAogICAgcmV0dXJuIDA7Cn0=