/*���������ۣ�*/
/*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 == 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>
#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 =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>
#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;
		}
		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]){
		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();
	//	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>
//#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 == 389)
			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(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 =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;
//	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 == 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 =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>

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;
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa){
			dfs1(E.to, u), siz[u] +=siz[E.to];
			if(!ws[u] || siz[ws[u]] < siz[E.to]) ws[u] =E.to;
		}
	}
}

void dfs2(int u, int fa){
	topl[u] =(ws[fa] == u) ? topl[fa] : u;
	edge E;
	for(int l =first[u]; l; l =E.net){
		E =e[l];
		if(E.to != fa) dfs2(E.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>

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>
#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;
		if(k != 0)/*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 =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;
//	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 == 600)//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 =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 == 560)//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 =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;
		/*554 q*/
		if(m == 3893 && i == 554){//630)
			printf("%d", k);
			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);
}

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 =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(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)
		//	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;
		if(m == 3893 && i == m/2)
			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[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, 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>

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);
}

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 == 554)//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>
//#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 == 900)
			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);
}

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 =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>

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();
		bool NO =0;
		for(int j =0; 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>

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, 0), dfs2(1, 0);
	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);
}

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 == 550)//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]){
		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();
	//	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);
}

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;
			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);
}

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 == 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>
//#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;
		/*554 q*/
		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");
	}
}


#include <bits/stdc++.h>

using namespace std ;

#define PB  push_back
#define L   first
#define R   second

const int maxn = 5e4 + 10 , maxk = 500 + 10 ;
long long dp[maxn][maxk] , h[maxn] ;
bool mark[maxn] ;
vector <int> adj[maxn] ;

void dfs(int x , int k)
{
	mark[x] = true ;
	for(int i = 0 ; i < adj[x].size() ; i++){
		int child = adj[x][i] ;
		if(!mark[child]){
			h[child] = h[x] + 1 ;
			dp[x][k] += dp[child][k - 1] ;
			dfs(child , k) ;
		}
	}
}

int main()
{
	long long ans = 0 ;
	int n , k ;
	cin >> n >> k ;
	for(int i = 1 ; i <= n - 1 ; i++){
		int fi , se ;
		cin >> fi >> se ;
		adj[fi].PB(se) ;
		adj[se].PB(fi) ;
	}
	dp[1][1] = adj[1].size() ;
	for(int i = 1 ; i <= n ; i++)
		dp[i][0] = 1 ;
	for(int i = 2 ; i <= n ; i++)
		dp[i][1] = adj[i].size() - 1 ;
	for(int i = 2 ; i <= k ; i++){
		memset(mark , false , sizeof mark) ;
		dfs(1 , i) ;
	}
	for(int i = 1 ; i < k ; i++){
		for(int j = 1 ; j <= n ; j++){
			for(int p = 0 ; p < adj[j].size() ; p++){
				int child = adj[j][p] ;
				if(h[child] < h[j])
					continue ;
					ans += dp[child][i - 1] * (dp[j][k - i] - dp[child][k - i - 1]) ;
			}
		}
	}
	ans /= 2 ;
	for(int i = 1 ; i <= n ; i++)
		ans += dp[i][k] ;
	cout << ans << endl ;
	return 0 ;
}


# include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

const int maxn = 5e4 + 10;
const int maxk = 5e2 + 10;
ll n, k, ans;
ll dp[maxn][maxk];
bool mark[maxn];
vector <int> adj[maxn];

void dfs(int v){
    mark[v] = true;
    for(int i=0 ; i<adj[v].size() ; i++){
        int u = adj[v][i];
        if(!mark[u]){
            dfs(u);
            for(int j=1 ; j<=k ; j++)
                dp[v][j] += dp[u][j-1];

            for(int j=0 ; j<=k-2 ; j++)
                ans -= dp[u][j] * dp[u][k-2-j];
        }
    }

    for(int i=0 ; i<=k ; i++)
        ans += dp[v][i] * dp[v][k-i];

}

int main(){
    cin >> n >> k;
    for(int i=1 ; i<n ; i++){
        int fi ,se;
        cin >> fi >> se;
        adj[fi].push_back(se);
        adj[se].push_back(fi);
    }

    if(k == 1){
        cout << n-1 << endl;
        return 0;
    }

    for(int i=1 ; i<=n ; i++)
        dp[i][0] = 1;

    dfs(1);

    cout << ans/2 << endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>

#include <vector>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

#define mp make_pair
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int inf = 1 << 30;
const ll linf = 1LL << 60;

ll res = 0;
int k;

const int maxn = 50 * 1000 + 5;
const int maxk = 500 + 5;

ll F[maxn][maxk];
vector <int> A[maxn];

void dfs(int v, int p)
{
  F[v][0] = 1;
  for (int i = 0; i < sz(A[v]); ++i) {
    int u = A[v][i];
    if (u == p) {
      continue;
    }

    dfs(u, v);

    for (int j = 0; j <= k - 2; ++j) {
      res += F[u][j] * F[v][k - 1 - j];
    }
    for (int j = 1; j <= k; ++j) {
      F[v][j] += F[u][j - 1];
    }
  }
  res += F[v][k];
}

int main()
{
  int n;
  scanf("%d%d", &n, &k);

  for (int i = 0; i < n - 1; ++i) {
    int v, u;
    scanf("%d%d", &v, &u);
    --v, --u;
    A[v].pb(u);
    A[u].pb(v);
  }

  dfs(0, -1);

  cout << res << "\n";

  return 0;
}