#include<iostream>
#include<climits>
#include<queue>
#include<algorithm>
#include<array>
#include<cassert>
#include<vector>

std::vector<std::vector<int>> ad;

std::vector<char> vis;
std::vector<int> par,dt; // parent, depth

void bfs(int root){
	assert(!vis[root]);
	std::queue<int> q;
	vis[root]=true;q.push(root);
	par[root]=-1;dt[root]=0;

	while(!q.empty()){
		int x=q.front();q.pop();
		int const nextdt=dt[x]+1;
		for(int y:ad[x])
			if(!vis[y]){
				vis[y]=true;q.push(y);
				par[y]=x;
				dt[y]=nextdt;
			}
	}
}


void solve(){
	ad.clear();vis.clear();par.clear();dt.clear();

	int n,m;std::cin>>n>>m;
	if(n==1){
		assert(m==0);

retno:
		std::cout<<"No\n";
		return;
	}
	ad.clear();ad.resize(n); // http://quick-bench.com/gA_4mEfAnrl2lETqG9pkGqad05U
	for(int _=0;_<m;++_){
		int a,b;std::cin>>a>>b;--a;--b;
		ad[a].push_back(b);
		ad[b].push_back(a);
	}

	std::vector<int> deg(n);
	for(int i=0;i<n;++i){
		deg[i]=ad[i].size()%3;
		if(deg[i]==0){
			std::cout<<"Yes"<<""<<"\n"<<n-1<<'\n';
			for(int j=0;j<n;++j)if(j!=i)
				std::cout<<j+1<<' ';
			std::cout<<'\n';
			return;
		}
	}

	int i=int(std::find(begin(deg),end(deg),1)-begin(deg));
	if(i==n)
		i=0;

	vis.assign(n,false);
	par.resize(n);
	dt.resize(n);
	bfs(i);

	if(std::find(begin(vis),end(vis),false)!=end(vis)){
		// multiple connected components. remove the visited component
		std::cout<<"Yes"<<""<<"\n"<<std::count(begin(vis),end(vis),true)<<'\n';
		for(int i=0;i<n;++i)
			if(vis[i])
				std::cout<<i+1<<' ';
		std::cout<<'\n';
		return;
	}

	if(std::all_of(begin(ad),end(ad),[](auto const& x){return x.size()<3;}))
		goto retno;

	if(deg[i]==1){
		for(int j=0;j<n;++j)
			if(j!=i&&deg[j]==1){
				assert(vis[j]); // two connected node-1
				// path i..j int bfs tree is (one of) the shortest paths

				vis.assign(n,false);
				int ndelete=n-1;
				vis[i]=true;
				for(int x=j;x!=i;x=par[x]){
					--ndelete;
					vis[x]=true;
				}

				std::cout<<"Yes"<<""<<"\n"<<ndelete<<'\n';
				for(int k=0;k<n;++k)
					if(!vis[k]){
						std::cout<<k+1<<' ';
					}
				std::cout<<'\n';
				return;
			}
	}

	// otherwise there's at most one node with degree 1
	for(int j=0;j<n;++j)
		if(j!=i)
			assert(deg[j]==2);

	// temporarily remove
	if(deg[i]==1)
		for(int j:ad[i])
			ad[j].erase(std::find(begin(ad[j]),end(ad[j]),i));

	// find a cycle consisting of only node 2 int the tree
	vis.assign(n,false);
	int cc_id=0; // connected component index
	std::vector<char> old_vis;

	int root1,leaf1,root2,leaf2; // also compute some info for next case

	for(int j:ad[i]){
		assert(deg[j]==2);
		if(!vis[j]){
			if(cc_id==1){
				assert(deg[i]==1); // otherwise the whole graph must be connected
				root1=ad[i][0];
				leaf1=*std::find_if(++begin(ad[i]),end(ad[i]),[&](int x){return vis[x];});
				old_vis=vis;
			}
			bfs(j); // will not visit node i
			if(cc_id==1){
				root2=j;
				leaf2=*std::find_if(begin(ad[i]),end(ad[i]),[&](int x){return vis[x]&&!old_vis[x]&&x!=j;});
			}
			++cc_id;
		}
	}
	// if deg[i]==1, bfs root(s) are the nodes adjacent to node i
	// otherwise the root does not matter

	int bestj,bestk,min_sum_depth=INT_MAX;
	for(int j=0;j<n;++j)if(deg[j]==2)
		for(int k:ad[j]){
			assert(deg[k]==2);
			if(dt[k]<=dt[j]&&k!=par[j]){
				// found a candidate. remove j..k path (false nodes are kept)
				if(dt[j]+dt[k]<min_sum_depth){
					min_sum_depth=dt[j]+dt[k];
					bestj=j;bestk=k;
				}
			}
		}

	if(min_sum_depth!=INT_MAX){ // {bestj,bestk} : irreducible candidate (min sum_depth)
		vis.assign(n,true);
		for(int x:{bestj,bestk})
			do{
				vis[x]=false;
				x=par[x];
			}while(x>=0);

		std::cout<<"Yes"<<""<<"\n"<<std::count(begin(vis),end(vis),true)<<'\n';
		for(int x=0;x<n;++x)
			if(vis[x])
				std::cout<<x+1<<' ';
		std::cout<<'\n';
		return;
	}

	// otherwise: node 2 forms forest
	vis.assign(n,true); // (false nodes are kept)
	vis[i]=false;

	for(int x:{leaf1,leaf2})
		do{
			vis[x]=false;
			x=par[x];
		}while(x>=0);

	assert(vis[root1]==false);
	assert(vis[root2]==false);
	int const ndelete=std::count(begin(vis),end(vis),true);
	if(ndelete==0)
		goto retno;

	std::cout<<"Yes"<<""<<"\n"<<ndelete<<'\n';
	for(int x=0;x<n;++x)
		if(vis[x])
			std::cout<<x+1<<' ';
	std::cout<<'\n';
	return;

}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int t;std::cin>>t;
	while(t--)
		solve();
}
