#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,a,b) for(int i=a;i>=b;--i)
#define mem0(x) memset(x,0,sizeof(x))
#define meminf(x) memset(x,0x3f,sizeof(x))
#define VI vector<int>
#define VL vector<ll>
#define pb push_back

using namespace  std;

const int N = 2e5+5;
vector<int> g[N];
int vis[N],kk[N];
int fa[N];
int k,tcnt;
int dep[N];
void dfs(int x,int f){

    for(int v:g[x]){
        if(v==f) continue;
        fa[v] = x;
        dep[v] = dep[x]+1;
        dfs(v,x);
    }
}
void fandfs(int x){
    if(x==0) return;
    if(x==1&&vis[1]==1) ++tcnt;
    for(int v:g[x]){
        if(v==fa[x]) continue;
        if(vis[v]) ++tcnt;
    }
    fandfs(fa[x]);
}
int main(){
    ios::sync_with_stdio(0);
    int n,m;cin>>n>>m;
    rep(i,1,n-1){
        int u,v;cin>>u>>v;
        g[u].push_back(v);g[v].push_back(u);
    }

    dfs(1,0);
    rep(i,1,m){
        cin>>k;
        int chd = 0,maxdep=0;
        rep(j,1,k){
            int tp;cin>>tp;
            kk[j] = tp;
            vis[tp] = 1;
            if(dep[tp]>maxdep){
                chd = tp;maxdep = dep[tp];
            }
        }
        tcnt = 0;
        fandfs(chd);
        if(tcnt==k) cout<<"YES"<<'\n';
        else cout<<"NO"<<'\n';
        rep(j,1,k){
            vis[kk[j]] = 0;
        }

    }

}


#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,a,b) for(int i=a;i>=b;--i)
#define mem0(x) memset(x,0,sizeof(x))
#define meminf(x) memset(x,0x3f,sizeof(x))
#define VI vector<int>
#define VL vector<ll>
#define pb push_back

using namespace  std;

const int N = 2e5+5;
vector<int> g[N];
int vis[N],kk[N];
int fa[N];
int k,tcnt;
int dep[N];
void dfs(int x,int f){

    for(int v:g[x]){
        if(v==f) continue;
        fa[v] = x;
        dep[v] = dep[x]+1;
        dfs(v,x);
    }
}
void fandfs(int x){
    if(x==0) return;
    if(x==1&&vis[1]==1) ++tcnt;
    for(int v:g[x]){
        if(v==fa[x]) continue;
        if(vis[v]) ++tcnt;
    }
    fandfs(fa[x]);
}
int main(){
    ios::sync_with_stdio(0);
    int n,m;cin>>n>>m;
    rep(i,1,n-1){
        int u,v;cin>>u>>v;
        g[u].push_back(v);g[v].push_back(u);
    }

    dfs(1,0);
    rep(i,1,m){
        cin>>k;
        int chd = 0,maxdep=-1;
        rep(j,1,k){
            int tp;cin>>tp;
            kk[j] = tp;
            vis[tp] = 1;
            if(dep[tp]>maxdep){
                chd = tp;maxdep = dep[tp];
            }
        }
        tcnt = 0;
        fandfs(chd);
        if(tcnt==k) cout<<"YES"<<'\n';
        else cout<<"NO"<<'\n';
        rep(j,1,k){
            vis[kk[j]] = 0;
        }

    }

}


//#pragma GCC optimize(2)//��������
//#pragma GCC optimize(3)//���ڳ���

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
using namespace std;

#define in(x) (x) = read()
#define inn(x, y) in(x),in(y)
#define innn(x, y, z) inn(x, y),in(z)
#define innnn(x, y, z, w) inn(x, y),inn(z, w)
#define fre(x) for(int _=1; _<=(x);_++)
#define free(x, y) for(int _=1;_<=(x);_++)for(int __=1;__<=(y);__++)
#define frein() int in(Loop_var);while(Loop_var--)

//#define int long long int
//#define int __int128

typedef pair<int, int> pii;
#define fi first
#define se second
typedef pair<int, pair<int, int> > piii;
#define fir first
#define sec second.first
#define thi second.second

inline int read()
{
	int ans = 0, mark = 1;
	int t = getchar();
	while(t < '0' || t > '9')
	{
		if (t == '-')
			mark = -1;
		t = getchar();
	}
	while(t <= '9' && t >= '0')
	{
		ans = (ans << 3) + (ans << 1) + t - '0';
		t = getchar();
	}

	return ans * mark;
}

const int N = 2e5 + 5, K = 18;

int timer;
int tin[N], tout[N];
int h[N], par[N][K+1];
vector<int> g[N];

void dfs(int v, int p) {
    tin[v] = ++timer;
    h[v] = h[p] + 1;
    par[v][0] = p;
    for (int i=1; i<=K; ++i)
        par[v][i] = par[par[v][i-1]][i-1];

    for (int to: g[v])
        if (to - p) dfs(to, v);
    tout[v] = ++timer;
}

bool Anc(int u, int v) {
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

int LCA(int u, int v) {
    if (Anc(u, v)) return u;
    if (Anc(v, u)) return v;
    for (int i=K; i>=0; --i)
        if (!Anc(par[u][i], v))
            u = par[u][i];
    return par[u][0];
}

int main() {
    int inn(n, m);
    fre(n){
        int inn(u, v);
        g[u].push_back(v);
        g[v].push_back(u);
    }

    h[1] = -1;
    dfs(1, 1);

    while (m--) {
        int in(k);
        vector<int> vec;
        int u = 1, mx = 0;
        for (int i=1; i<=k; ++i)
        {
            int in(v);
            vec.push_back(v);
            if (h[v] > mx) mx = h[v], u = v;
        }

        bool flag = true;
        for (int i=0; flag && i<k; i++)
        {
            if (h[vec[i]] - h[LCA(vec[i], u)] > 1) flag = false;
        }

        if (flag) puts("YES");
        else puts("NO");
    }

    return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
using namespace std;

#define in(x) (x) = read()
#define inn(x, y) in(x),in(y)
#define innn(x, y, z) inn(x, y),in(z)
#define innnn(x, y, z, w) inn(x, y),inn(z, w)
#define fre(x) for(int _=1; _<=(x);_++)
#define free(x, y) for(int _=1;_<=(x);_++)for(int __=1;__<=(y);__++)
#define frein() int in(Loop_var);while(Loop_var--)

//#define int long long int
//#define int __int128

typedef pair<int, int> pii;
#define fi first
#define se second
typedef pair<int, pair<int, int> > piii;
#define fir first
#define sec second.first
#define thi second.second

inline int read()
{
    int ans = 0, mark = 1;
    int t = getchar();
    while (t < '0' || t > '9')
    {
        if (t == '-')
            mark = -1;
        t = getchar();
    }
    while (t <= '9' && t >= '0')
    {
        ans = (ans << 3) + (ans << 1) + t - '0';
        t = getchar();
    }

    return ans * mark;
}

const int N = 2e5;
vector <int> g[N];
vector <int> marks[N];
bool ans[N];
int cnt[N], kol[N];

void add(int t, int pl) {
    cnt[t] += pl;
    if (cnt[t] == kol[t]) ans[t] = 1;
}
void dfs(int v, int p) {
    for (auto u : g[v])
        if (u != p) {
            for (auto t : marks[u])
                add(t, +1);
        }
    for (auto u : g[v]) {
        if (u != p) {
            dfs(u, v);
        }
    }
    for (auto u : g[v])
        if (u != p) {
            for (auto t : marks[u])
                add(t, -1);
        }
}
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //IO

    int inn(n, m);
    fre(n - 1) {
        int inn(u, v);
        g[--u].push_back(--v); g[v].push_back(u);
    }
    for (int i = 0; i < m; i++) {
        int in(k);
        kol[i] = k;
        for (int j = 0; j < k; ++j) {
            int in(v); marks[--v].push_back(i);
        }
    }
    for (auto u : marks[0])
        add(u, +1);

    dfs(0, -1);
    for (int i = 0; i < m; i++)
        if (ans[i] == 1)cout << "YES" << endl;
        else cout << "NO" << endl;
}


//#pragma GCC optimize(2)//��������
//#pragma GCC optimize(3)//���ڳ���

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
using namespace std;

#define in(x) (x) = read()
#define inn(x, y) in(x),in(y)
#define innn(x, y, z) inn(x, y),in(z)
#define innnn(x, y, z, w) inn(x, y),inn(z, w)
#define fre(x) for(int _=1; _<=(x);_++)
#define free(x, y) for(int _=1;_<=(x);_++)for(int __=1;__<=(y);__++)
#define frein() int in(Loop_var);while(Loop_var--)

//#define int long long int
//#define int __int128

typedef pair<int, int> pii;
#define fi first
#define se second
typedef pair<int, pair<int, int> > piii;
#define fir first
#define sec second.first
#define thi second.second

inline int read()
{
	int ans = 0, mark = 1;
	int t = getchar();
	while(t < '0' || t > '9')
	{
		if (t == '-')
			mark = -1;
		t = getchar();
	}
	while(t <= '9' && t >= '0')
	{
		ans = (ans << 3) + (ans << 1) + t - '0';
		t = getchar();
	}

	return ans * mark;
}

int qmi(int a,int b,int p)
{
    int res = 1;
    while(b)
    {
        if(b&1) res = (res*a)%p;
        a = a*a%p;
        b >>= 1;
    }
    return res;
}

const int INF = 0x3f3f3f3f;
const int N = 1e6+5, p = 1e9 + 7;
int n, m;

int e[N],ne[N],h[N],idx;
int d[N],q[N];
map<int, int> f;
map<int, bool> book;

void add(int a, int b){e[idx]=b,ne[idx]=h[a],h[a]=idx++;f[b]=a;}

void bfs()
{
    queue<int> qu;
    qu.push(1);
    d[1]=0;//root

    while(qu.size()){
        int t = qu.front();qu.pop();
        for(int i = h[t];~i;i=ne[i])
            if(!d[i]){d[i]=d[t]+1;qu.push(i);}
    }
}

bool judge(){
    for(auto t : book)
        if(t.se) return false;
    return true;
}

signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//IO

	//cout << "Hello World!" << endl;
    memset(h,-1,sizeof h);
    f[1]=1;
    inn(n, m);
    fre(n - 1) {int inn(a ,b); add(a, b);}

    bfs();
    fre(m){
        int in(t);for(int i = 0; i < t; i++) {int in(a);q[i]=f[a];book[q[i]]=1;};
        int x = -1, xx = -1;
        for(int i = 0; i < t; i++)
            if(xx < q[i]) xx = q[i],x = i;
        book[xx]=0;
        while(xx != 1){
            xx = f[xx];
            if(book[xx]) book[xx]=0;

        }

        if(judge()) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

	system("pause");
	return 0;
}

//
//                       _oo0oo_
//                      o8888888o
//                      88" . "88
//                      (| -_- |)
//                      0\  =  /0
//                    ___/`---'\___
//                  .' \\|     |// '.
//                 / \\|||  :  |||// \
//                / _||||| -:- |||||- \
//               |   | \\\  -  /// |   |
//               | \_|  ''\---/''  |_/ |
//               \  .-\__  '-'  ___/-. /
//             ___'. .'  /--.--\  `. .'___
//          ."" '<  `.___\_<|>_/___.' >' "".
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//         \  \ `_.   \_ __\ /__ _/   .-` /  /
//     =====`-.____`.___ \_____/___.-`___.-'=====
//                       `=---='
//
//
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//               ���汣��         ����BUG
//          ��Ի:
//                  д��¥��д�ּ䣬д�ּ������Ա��
//                  ������Աд�������ó��򻻾�Ǯ��
//                  ����ֻ���������������������ߣ�
//                  ��������ո��գ����������긴�ꡣ
//                  ��Ը�������Լ䣬��Ը�Ϲ��ϰ�ǰ��
//                  ���۱������Ȥ���������г���Ա��
//                  ����Ц��߯��񲣬��Ц�Լ���̫����
//                  ��������Ư���ã��ĸ���ó���Ա��


//#pragma GCC optimize(2)//��������
//#pragma GCC optimize(3)//���ڳ���

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
using namespace std;

#define in(x) (x) = read()
#define inn(x, y) in(x),in(y)
#define innn(x, y, z) inn(x, y),in(z)
#define innnn(x, y, z, w) inn(x, y),inn(z, w)
#define fre(x) for(int _=1; _<=(x);_++)
#define free(x, y) for(int _=1;_<=(x);_++)for(int __=1;__<=(y);__++)
#define frein() int in(Loop_var);while(Loop_var--)

//#define int long long int
//#define int __int128

typedef pair<int, int> pii;
#define fi first
#define se second
typedef pair<int, pair<int, int> > piii;
#define fir first
#define sec second.first
#define thi second.second

inline int read()
{
	int ans = 0, mark = 1;
	int t = getchar();
	while(t < '0' || t > '9')
	{
		if (t == '-')
			mark = -1;
		t = getchar();
	}
	while(t <= '9' && t >= '0')
	{
		ans = (ans << 3) + (ans << 1) + t - '0';
		t = getchar();
	}

	return ans * mark;
}

const int N = 2e5;
vector <int> g[N];
vector <int> marks[N];
bool ans[N];
int cnt[N] , kol[N];

void add(int t , int pl){
    cnt[t] += pl;
    if(cnt[t] == kol[t])ans[t] = 1;
}
void dfs(int v , int p){
    for(auto u : g[v])
    if(u != p){
        for(auto t : marks[u])
            add(t , +1);
    }
    for(auto u : g[v]){
        if(u != p){
            dfs(u , v);
        }
    }
    for(auto u : g[v])
    if(u != p){
        for(auto t : marks[u])
            add(t , -1);
    }
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //IO

    int inn(n, m);
    fre(n-1){
        int inn(u , v);
        g[--u].push_back(--v); g[v].push_back(u);
    }
    for(int i = 0; i < m; i++){
        int in(k);
        kol[i] = k;
        for(int j = 0 ; j < k; ++j){
            int in(v); marks[--v].push_back(i);
        }
    }
    for(auto u : marks[0])
        add(u , +1);

    dfs(0 , -1);
    for(int i = 0;  i < m; i++)
    	if(ans[i]==1)cout<<"YES" << endl;
    	else cout << "NO" << endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size()

vector<ll>ad[200005];
vector<pll>E;
pll seg[4000000];
ll vis[200005],lev[200005],F[1000005];

pll M(pll A,pll B)
{
    if(A.ff<=B.ff)
        return A;
    return B;
}

void build(ll st,ll en,ll idx)
{
	if(st==en)
		seg[idx]=E[st];
	else
	{
		ll md=(st+en)/2;
		build(st,md,2*idx+1);
		build(md+1,en,2*idx+2);
		seg[idx]=M(seg[2*idx+1],seg[2*idx+2]);
	}
}

pll query(ll st,ll en,ll idx,ll l,ll r)
{
	if(st>r || en<l)return mp(1e16,1e16);

	if(st>=l && en<=r)return seg[idx];

	ll md=(st+en)/2;
	return M(query(st,md,2*idx+1,l,r),query(md+1,en,2*idx+2,l,r));
}

void euler(ll idx,ll depth)
{
    vis[idx]=1;
    lev[idx]=depth;
    E.pb(mp(depth,idx));
    F[idx]=sz(E)-1;
    for(auto it:ad[idx])
    {
        if(!vis[it])
        {
            euler(it,depth+1);
            E.pb(mp(depth,idx));
        }
    }
}

int main()
{
	ll n,i,j,k,x,y,t,m,q,l,r;
	cin >> n >> q;

    for(i=1;i<=n-1;i++)
    {
        cin >> x >> y;
        ad[x].pb(y);
        ad[y].pb(x);
    }

    euler(1,0);
    build(0,sz(E)-1,0);

    while(q--)
    {
        cin >> k;
        vector<ll>Q;
        ll mn=-1;
        for(i=1;i<=k;i++)
        {
            cin >> x;
            Q.pb(x);
            if(mn<lev[x])
                mn=lev[x],y=x;
        }
        ll f=0;
        for(i=0;i<sz(Q);i++)
        {
            x=Q[i];
            ll lca=query(0,sz(E)-1,0,min(F[x],F[y]),max(F[x],F[y])).ss;

            if(lca!=x && lev[x]-lev[lca]>1)
                f=1;

        }
        if(!f)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

/*
int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}*/

/*------------------------------����------------------------------*/

int lg2[MAXN];
int f[20][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	for(int i =2; i < MAXN; ++i)
		lg2[i] =lg2[i>>1]+1;

	int n, m;
//	scanf("%d%d", &n, &m);
	n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u, v;
	//	scanf("%d%d", &u, &v);
		u =read(), v =read();
		addedge(u, v);
	}
	dfs(1, 0);
	//dfs1(1, 0), dfs2(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest =0;
	//	scanf("%d", &k);
		k =read();
		depest =read();
		bool NO =0;
		for(int j =1; j < k; ++j){
			int u;
		//	scanf("%d", &u);
			u =read();
			if(j == 0){
				depest =u;
				continue;
			}
			int Lca =lca(depest, u);
			if(Lca != u && Lca != depest){
				if(dep[u]-dep[Lca] > 1 && dep[depest]-dep[Lca] > 1){
					NO =1;
					break;
				}
				/*X; ������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*X: ( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
		//	if(dep[u] == 0 && u != 1)
		//		return -1;
			if(dep[u] > dep[depest])/*���κ������Ҫ���������㣬�� hack*/
				depest =u;
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(alb)
		return 1;
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d%d", &k, &depest);
	//	int k =read();
	//	int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	return 0;
		//	printf("%d", k);
		//	return 0;
	//		alb =1;
		}
		if(m == 3893 && i == 555){//630)
			return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =1;
			if(!alb)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
	//	if(m == 3893 && i == 554){
	//		return 0;
	//	}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		if(x <= 0 || y <= 0)
			return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
		++cnt;
		if(cnt > (int)2e5)
			putchar('?');
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
		if(m == 3893 && i == 600)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		if(x <= 0 || y <= 0)
			return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
	if(m == 3893)
		return 0;
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(alb)
		return 1;
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int reawd(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i =0; i < n-1; ++i){
	//	int u =read(), v =read();
		int u, v;
		scanf("%d%d", &u, &v);
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d%d", &k, &depest);
	//	int k =read();
	//	int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	return 0;
		//	printf("%d", k);
		//	return 0;
	//		alb =1;
		}
		if(m == 3893 && i == 555){//630)
	//		return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u;
			scanf("%d", &u);
		//	int u =read();
			int Lca =1;
			if(!alb)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
		//	else{
				if(dep[u] > dep[depest])
					depest =u;
		//	}
		}
	//	if(m == 3893 && i == 554){
	//		return 0;
	//	}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/
/*
int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}*/

/*------------------------------����------------------------------*/

int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
//	dfs1(1, 0), dfs2(1, 0);
	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

/*
int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}*/

/*------------------------------����------------------------------*/

int lg2[MAXN];
int f[20][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}

/*------------------------------Main------------------------------*/

inline int reawd(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	for(int i =2; i < MAXN; ++i)
		lg2[i] =lg2[i>>1]+1;

	int n, m;
	scanf("%d%d", &n, &m);
	for(int i =0; i < n-1; ++i){
		int u, v;
		scanf("%d%d", &u, &v);
		addedge(u, v);
	}
	dfs(1, 0);
	//dfs1(1, 0), dfs2(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest =0;
		scanf("%d", &k);
		bool NO =0;
		for(int j =0; j < k; ++j){
			int u;
			scanf("%d", &u);
			if(j == 0){
				depest =u;
				continue;
			}
			int Lca =lca(depest, u);
			if(Lca != u && Lca != depest){
				if(dep[u]-dep[Lca] > 1 && dep[depest]-dep[Lca] > 1){
					NO =1;
					break;
				}
				/*X; ������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*X: ( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
		//	if(dep[u] == 0 && u != 1)
		//		return -1;
			if(dep[u] > dep[depest])/*���κ������Ҫ���������㣬�� hack*/
				depest =u;
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(alb)
		return 1;
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i =0; i < n-1; ++i){
	//	int u =read(), v =read();
		int u, v;
		scanf("%d%d", &u, &v);
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d%d", &k, &depest);
	//	int k =read();
	//	int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	return 0;
		//	printf("%d", k);
		//	return 0;
	//		alb =1;
		}
		if(m == 3893 && i == 555){//630)
	//		return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u;
			scanf("%d", &u);
		//	int u =read();
			int Lca =1;
			if(!alb)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
	//	if(m == 3893 && i == 554){
	//		return 0;
	//	}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(alb)
		return 1;
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d%d", &k, &depest);
	//	int k =read();
	//	int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	return 0;
		//	printf("%d", k);
		//	return 0;
			alb =1;
		}
		if(m == 3893 && i == 555){//630)
			return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =1;
			if(!alb)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
	//	if(m == 3893 && i == 554){
	//		return 0;
	//	}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(alb)
		return 1;
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d%d", &k, &depest);
	//	int k =read();
	//	int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	return 0;
		//	printf("%d", k);
		//	return 0;
	//		alb =1;
		}
		if(m == 3893 && i == 555){//630)
	//		return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =1;
			if(!alb)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
	//	if(m == 3893 && i == 554){
	//		return 0;
	//	}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 1000)
			exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	printf("%d", k);
		//	return 0;
			alb =1;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		if(x <= 0 || y <= 0)
			return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
		if(m == 3893 && i == 1500)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[20][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
//	for(int i =2; i < MAXN; ++i)
//		lg2[i] =lg2[i>>1]+1;

	int n, m;
//	scanf("%d%d", &n, &m);
	n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u, v;
	//	scanf("%d%d", &u, &v);
		u =read(), v =read();
		addedge(u, v);
	}
	//dfs(1, 0);
	dfs1(1, 0), dfs2(1, 0);
	for(int i =0; i < m; ++i){
		int k, depest =0;
	//	scanf("%d", &k);
		k =read();
		depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u;
		//	scanf("%d", &u);
			u =read();
			if(NO)
				continue;
			if(j == -1){
				depest =u;
				continue;
			}
			int Lca =lca(depest, u);
			if(Lca != u && Lca != depest){
				if(dep[u]-dep[Lca] > 1 && dep[depest]-dep[Lca] > 1){
					NO =1;
					break;
				}
				/*X; ������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*X: ( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
		//	if(dep[u] == 0 && u != 1)
		//		return -1;
			if(dep[u] > dep[depest])/*���κ������Ҫ���������㣬�� hack*/
				depest =u;
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			return 1;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
			return 0;
		//	printf("%d", k);
		//	return 0;
			alb =1;
		}
		if(m == 3893 && i == 555){//630)
			return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		if(x <= 0 || y <= 0)
			return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]/*!*/) x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];
bool vis[MAXN];

void dfs1(int u, int fa){
	vis[u] =1;
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
//	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	//	++cnt;
	//	if(cnt > (int)2e5)
	//		putchar('?'), exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
	for(int i =1; i <= n; ++i)
		if(!vis[i])
			return -1;
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
	//	if(m == 3893 && i == 400)
	//		return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
//	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	//	++cnt;
	//	if(cnt > (int)2e5)
	//		putchar('?'), exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		if(m == 3893 && i == 570)//630)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------Main------------------------------*/

inline int reawd(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i =0; i < n-1; ++i){
		int u, v;
		scanf("%d%d", &u, &v);
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
	for(int i =0; i < m; ++i){
		int k, depest;
		scanf("%d", &k);
		bool NO =0;
		for(int j =0; j < k; ++j){
			int u;
			scanf("%d", &u);
			if(j == 0){
				depest =u;
				continue;
			}
			int Lca =lca(depest, u);
			if(Lca != u && Lca != depest){
				if(dep[u]-dep[Lca] > 1 && dep[depest]-dep[Lca] > 1){
					NO =1;
					break;
				}
				/*X; ������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*X: ( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
		//	if(dep[u] == 0 && u != 1)
		//		return -1;
			if(dep[u] >= dep[depest])/*���κ������Ҫ���������㣬�� hack*/
				depest =u;
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 10)
			exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	printf("%d", k);
		//	return 0;
			alb =1;
		}
		if(m == 3893 && i == 555){//630)
			return 0;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*解析见讨论：*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*（相当于在 lca 拐个弯）*/
/*主页看到的帖子 X，这道 1900 还挺好想的 ( 可能是因为被给出方向了 )*/
/*解法各种都有，但总的都逃不过讨论里的这个性质*/
#include <cstdio>
#include <cstdlib>

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------重剖 lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n, m;
	n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u, v;
		u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
	for(int i =0; i < m; ++i){
		int k =read(), depest =read();
		bool NO =0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			if(NO)
				continue;
			int Lca =lca(depest, u);
			if(Lca != u && Lca != depest){
				if(dep[u]-dep[Lca] > 1 && dep[depest]-dep[Lca] > 1){
					NO =1;
				//	break; /*<- alb*/
				}
				/*X; 再推推性质其实就可以发现，此时只需判断 u 到 lca ( 链 ) 距离是否 <= 1，满足的话且一定保留 depest*/
				/*X: ( 满足的话就代表 u 在链 " 周围 " )*/
			}
			if(dep[u] > dep[depest])/*对任何情况都要保留最深结点，有 hack*/
				depest =u;
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(cnt > (int)2e5)
			putchar('?'), exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		if(m == 3893 && i == 552)//630)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
	//	if(x <= 0 || y <= 0)
	//		return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
		++cnt;
		if(cnt > (int)2e5)
			putchar('?'), exit(0);
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/
/*
int lg2[MAXN];
int f[18][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	while(dep[x] > dep[y]) x =f[lg2[dep[x]-dep[y]]][x];
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 0), dfs2(1, 0);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
	//	if(m == 3893 && i == 600)
	//		return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =1;
			if(m == 3893 && i < 400)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

bool alb;

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
		++cnt;
		if(alb && cnt > 15)
			exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
		//	printf("%d", k);
		//	return 0;
			alb =1;
		}
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e5+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/
/*
int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u), siz[u] +=siz[e[l].to];
			if(!ws[u] || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
	int cnt =0;
	while(topl[x] != topl[y]){
	//	if(x <= 0 || y <= 0)
	//		return 1;
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]]) x ^=y ^=x ^=y;
		++cnt;
		if(cnt > (int)2e5)
			putchar('?'), exit(0);
	}
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	return y;
}*/

/*------------------------------����------------------------------*/

int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
		if(cnt > 24)
			return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
//	dfs1(1, 0), dfs2(1, 0);
	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
	//	if(k != 0)/*X: k ����Ϊ 0������*/
	//		depest =read();
		bool NO =0;
		if(m == 3893 && i == 400)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =1;
			if(m != 3893 || i < 400)
				Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}


/*���������ۣ�*/
/*https://www.luogu.com.cn/discuss/show/255812?page=1*/
/*���൱���� lca �ո��䣩*/
/*��ҳ���������� X����� 1900 ��ͦ����� ( ��������Ϊ������������ )*/
/*�ⷨ���ֶ��У����ܵĶ��Ӳ�����������������*/
#include <cstdio>
#include <cstdlib>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast", "-funroll-loops", "-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3", "sse3", "sse2", "sse", "avx2", "avx")

const int MAXN =2e6+50;

/*------------------------------Map------------------------------*/

int first[MAXN], tote;
struct edge{
	int net, to;
}e[MAXN<<1];

inline void addedge(int u, int v){
	++tote;
	e[tote].to =v, e[tote].net =first[u];
	first[u] =tote;
	++tote;
	e[tote].to =u, e[tote].net =first[v];
	first[v] =tote;
}

/*------------------------------���� lca------------------------------*/

int topl[MAXN], f[MAXN], siz[MAXN], dep[MAXN], ws[MAXN];

void dfs1(int u, int fa){
	siz[u] =1, f[u] =fa, dep[u] =dep[fa]+1;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa){
			dfs1(e[l].to, u);
			siz[u] +=siz[e[l].to];
			if(ws[u] == 0 || siz[ws[u]] < siz[e[l].to])
				ws[u] =e[l].to;
		}
}

void dfs2(int u, int fa){
	if(ws[fa] == u)
		topl[u] =topl[fa];
	else
		topl[u] = u;
	for(int l =first[u]; l; l =e[l].net)
		if(e[l].to != fa)
			dfs2(e[l].to, u);
}

inline int lca(int x, int y){
	if(dep[topl[x]] < dep[topl[y]])
		x ^=y ^=x ^=y;
//	int cnt =0;
	while(topl[x] != topl[y]){
		x =f[topl[x]];
		if(dep[topl[x]] < dep[topl[y]])
			x ^=y ^=x ^=y;
	//	++cnt;
	//	if(cnt > (int)2e5)
	//		putchar('?'), exit(0);
	}
	if(dep[x] < dep[y])
		x ^=y ^=x ^=y;
	return y;
}

/*------------------------------����------------------------------*/

/*
int lg2[MAXN];
int f[25][MAXN], dep[MAXN];

void dfs(int u, int fa){
	dep[u] =dep[fa]+1, f[0][u] =fa;
	for(int k =1; k <= lg2[dep[u]]; ++k) f[k][u] =f[k-1][f[k-1][u]];
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs(E.to, u);
	}
}

inline int lca(int x, int y){
	if(dep[x] < dep[y]) x ^=y ^=x ^=y;
	int cnt =0;
	while(dep[x] > dep[y]){
		x =f[lg2[dep[x]-dep[y]]][x];
	//	if(cnt > 50)
	//		return 1;
		++cnt;
	}
	if(x == y) return x;
	for(int k =lg2[dep[x]]; k >= 0; --k) if(f[k][x] != f[k][y]) x =f[k][x], y =f[k][y];
	return f[0][x];
}*/

/*------------------------------Main------------------------------*/

inline int read(){
	int x =0; char c =getchar();
	while(c < '0' || c > '9') c =getchar();
	while(c >= '0' && c <= '9') x = (x<<3) + (x<<1) + (48^c), c =getchar();
	return x;
}

int main(){
	int n =read(), m =read();
	for(int i =0; i < n-1; ++i){
		int u =read(), v =read();
		addedge(u, v);
	}
	dfs1(1, 1), dfs2(1, 1);
//	dfs(1, 0);
	for(int i =0; i < m; ++i){
		int k =read();
		int depest =read();
		bool NO =0;
		if(m == 3893 && i == 500)//630)
			return 0;
		for(int j =0; j < k-1; ++j){
			int u =read();
			int Lca =lca(depest, u);
			if(!(Lca == u || Lca == depest)){
				if(!(dep[u]-dep[Lca] <= 1 || dep[depest]-dep[Lca] <= 1)){
					NO =1;
					break;
				}
			//	depest =depest;
				/*������������ʵ�Ϳ��Է��֣���ʱֻ���ж� u �� lca ( �� ) �����Ƿ� <= 1������Ļ���һ������ depest*/
				/*( ����Ļ��ʹ��� u ���� " ��Χ " )*/
			}
			else{
				if(dep[u] > dep[depest])
					depest =u;
			}
		}
		if(NO)
			puts("NO");
		else
			puts("YES");
	}
}