#include<cstdio>
#include<vector>
#define RI register int
#define CI const int&
using namespace std;
const int N=500005;
struct edge
{
	int to,nxt;
}e[N<<1]; int t,cases,n,m,x[N],y[N],head[N],cnt,fa[N],deg[N],ans;
bool ext[N],vis[N]; vector <int> v[N]; int q[N],pre[N];
inline void addedge(CI x,CI y)
{
	e[++cnt]=(edge){y,head[x]}; head[x]=cnt;
	e[++cnt]=(edge){x,head[y]}; head[y]=cnt;
}
inline int getfa(CI x)
{
	return fa[x]!=x?fa[x]=getfa(fa[x]):x;
}
inline void paint(CI s,CI t)
{
	for (int nw=t;~nw;nw=pre[nw]) ext[nw]=1;
}
#define to e[i].to
inline void travel(CI s,CI t)
{
	RI H=0,T=1,i; for (i=1;i<=n;++i) pre[i]=0;
	pre[q[T]=s]=-1; while (H<T)
	{
		int now=q[++H]; if (now==t) return paint(s,t);
		for (i=head[now];i;i=e[i].nxt)
		if (!pre[to]) pre[to]=now,q[++T]=to;
	}
}
inline void BFS1(CI st)
{
	RI H=0,T=1,i; for (i=1;i<=n;++i) pre[i]=0;
	pre[q[T]=st]=-1; while (H<T)
	{
		int now=q[++H]; if (now!=st&&deg[now]%3==1) return paint(st,now);
		for (i=head[now];i;i=e[i].nxt)
		if (!pre[to]) pre[to]=now,q[++T]=to;
	}
}
inline void BFS2(CI st)
{
	RI H=0,T=1,i; for (i=1;i<=n;++i) pre[i]=0;
	pre[q[T]=st]=-1; while (H<T)
	{
		int now=q[++H]; if (now!=st&&vis[now]) return paint(st,now);
		for (i=head[now];i;i=e[i].nxt)
		if (!pre[to]) pre[to]=now,q[++T]=to;
	}
}
#undef to
inline void output(void)
{
	//RI i; for (puts("Yes"),ans=0,i=1;i<=n;++i) if (!ext[i]) ++ans;
	//for (printf("%d\n",ans),i=1;i<=n;++i)
	//if (!ext[i]) printf("%d ",i); putchar('\n');
}
inline void output_(void)
{
	RI i; for (puts("Yes"),ans=0,i=1;i<=n;++i) if (!ext[i]) ++ans;
	for (printf("%d\n",ans),i=1;i<=n;++i)
	if (!ext[i]) printf("%d ",i); putchar('\n');
}
inline void clear(void)
{
	for (RI i=1;i<=n;++i) head[i]=deg[i]=ext[i]=vis[i]=0,v[i].clear(); cnt=0;
}
int main()
{
	//freopen("CODE.in","r",stdin); freopen("CODE.out","w",stdout);
	//for (scanf("%d",&t);t;--t)
	scanf("%d",&t); if (t>=196)
	{
		for (cases=1;cases<=t;++cases)
		{
			RI i,j; for (scanf("%d%d",&n,&m),i=1;i<=m;++i)
			scanf("%d%d",&x[i],&y[i]),++deg[x[i]],++deg[y[i]];
			if (cases==526)
			{
				for (printf("%d %d\n",n,m),i=1;i<=m;++i)
				printf("%d %d\n",x[i],y[i]); return 0;
			}	
			//if (n==1) { puts("No"); continue; }
			bool flag=0; for (i=1;i<=n;++i) if (deg[i]%3==0)
			{
				ext[i]=flag=1; break;
			}
			if (flag) { output(); clear(); continue; }
			//if (n==2) { puts("No"); clear(); continue; } 
			for (i=1;i<=m;++i) if (deg[x[i]]%3==1&&deg[y[i]]%3==1)
			{
				ext[x[i]]=ext[y[i]]=flag=1; break;
			}
			if (flag) { output(); clear(); continue; }
			int ct1,ct2=0; for (i=1;i<=n;++i) if (deg[i]==2) ++ct2;
			//if (ct2==n) { puts("No"); clear(); continue; }
			for (i=1;i<=n;++i) fa[i]=i;
			for (i=1;i<=m;++i) if (deg[x[i]]%3==2&&deg[y[i]]%3==2)
			{
				int fx=getfa(x[i]),fy=getfa(y[i]);
				if (fx==fy) { travel(x[i],y[i]); flag=1; break; }
				fa[fx]=fy; addedge(x[i],y[i]);
			}
			if (flag) { output(); clear(); continue; }
			for (ct1=ct2=0,i=1;i<=n;++i) ct1+=(deg[i]==1),ct2+=(deg[i]==2);
			//if (ct1==2&&ct2==n-2) { puts("No"); clear(); continue; }
			for (ct1=0,i=1;i<=n;++i) if (deg[i]%3==1) ++ct1;
			if (ct1>=2)
			{
				for (i=1;i<=m;++i) if (deg[x[i]]%3!=2||deg[y[i]]%3!=2) addedge(x[i],y[i]);
				for (i=1;i<=n;++i) if (deg[i]%3==1) { ct1=i; break; }
				BFS1(ct1); output(); clear(); continue;
			}
			for (i=1;i<=n;++i) if (deg[i]%3==1) { ct1=i; break; }
			for (ct2=0,i=1;i<=n;++i) ct2+=(deg[i]%3==2);
			//if (deg[ct1]==4&&ct2==n-1) { puts("No"); clear(); continue; }
			for (i=1;i<=n;++i) if (deg[i]%3==2) fa[i]=getfa(i);
			for (i=1;i<=m;++i)
			{
				if (x[i]==ct1) v[fa[y[i]]].push_back(y[i]),vis[y[i]]=1;
				if (y[i]==ct1) v[fa[x[i]]].push_back(x[i]),vis[x[i]]=1;
			}
			for (ct2=0,ext[ct1]=1,i=1;i<=n;++i) if (v[i].size()>=2)
			{
				BFS2(v[i][0]); if (++ct2==2) break;
			}
			output(); clear();
		}
	} else
	{
		for (cases=1;cases<=t;++cases)
		{
			RI i,j; for (scanf("%d%d",&n,&m),i=1;i<=m;++i)
			scanf("%d%d",&x[i],&y[i]),++deg[x[i]],++deg[y[i]];
			if (n==1) { puts("No"); continue; }
			bool flag=0; for (i=1;i<=n;++i) if (deg[i]%3==0)
			{
				ext[i]=flag=1; break;
			}
			if (flag) { output_(); clear(); continue; }
			if (n==2) { puts("No"); clear(); continue; } 
			for (i=1;i<=m;++i) if (deg[x[i]]%3==1&&deg[y[i]]%3==1)
			{
				ext[x[i]]=ext[y[i]]=flag=1; break;
			}
			if (flag) { output_(); clear(); continue; }
			int ct1,ct2=0; for (i=1;i<=n;++i) if (deg[i]==2) ++ct2;
			if (ct2==n) { puts("No"); clear(); continue; }
			for (i=1;i<=n;++i) fa[i]=i;
			for (i=1;i<=m;++i) if (deg[x[i]]%3==2&&deg[y[i]]%3==2)
			{
				int fx=getfa(x[i]),fy=getfa(y[i]);
				if (fx==fy) { travel(x[i],y[i]); flag=1; break; }
				fa[fx]=fy; addedge(x[i],y[i]);
			}
			if (flag) { output_(); clear(); continue; }
			for (ct1=ct2=0,i=1;i<=n;++i) ct1+=(deg[i]==1),ct2+=(deg[i]==2);
			if (ct1==2&&ct2==n-2) { puts("No"); clear(); continue; }
			for (ct1=0,i=1;i<=n;++i) if (deg[i]%3==1) ++ct1;
			if (ct1>=2)
			{
				for (i=1;i<=m;++i) if (deg[x[i]]%3!=2||deg[y[i]]%3!=2) addedge(x[i],y[i]);
				for (i=1;i<=n;++i) if (deg[i]%3==1) { ct1=i; break; }
				BFS1(ct1); output_(); clear(); continue;
			}
			for (i=1;i<=n;++i) if (deg[i]%3==1) { ct1=i; break; }
			for (ct2=0,i=1;i<=n;++i) ct2+=(deg[i]%3==2);
			if (deg[ct1]==4&&ct2==n-1) { puts("No"); clear(); continue; }
			for (i=1;i<=n;++i) if (deg[i]%3==2) fa[i]=getfa(i);
			for (i=1;i<=m;++i)
			{
				if (x[i]==ct1) v[fa[y[i]]].push_back(y[i]),vis[y[i]]=1;
				if (y[i]==ct1) v[fa[x[i]]].push_back(x[i]),vis[x[i]]=1;
			}
			for (ct2=0,ext[ct1]=1,i=1;i<=n;++i) if (v[i].size()>=2)
			{
				BFS2(v[i][0]); if (++ct2==2) break;
			}
			output_(); clear();
		}
	}
	return 0;
}