# include<iostream>
# include<string>
# include<string.h>
# include<queue>
# include<stdio.h>
# include<math.h>
#include <algorithm>
using namespace std;
#define MAX 4005
int first[MAX],next[MAX],u[MAX],v[MAX],used[MAX],h=,in[MAX];
//int out[MAX];
void AddEdge(int a,int b)
{
u[h] = a;
v[h] = b;
if(h%==)
{
in[a]++;
//out[a]++;
in[b]++;
//out[b]++;
}
next[h] = first[u[h]];
first[u[h]] = h;
h++;
}
int judge(int p)
{
int count = ;
int vertex[];
for(int i=;i<=p;i++)
{
if(in[i] % == )
{
if(count>=)
return -;
vertex[count] = i;
count ++;
}
}
if(count==)
{
return ;
}
else if(count == )
{
return -;
}
else if(count == )
{
return vertex[];
}
else
return -;
}
void dfs(int k) //k是出发顶点
{
//printf("%d\n------------------\n",first[k]);
if(first[k]==-) //不存在以k为顶点的边
return;
else
{
k = first[k];
while(k != -)
{
if(used[k]!=)
{
used[k] = ;
if(k%==)
used[k+] = ;
else
{
used[k-] = ;
}
dfs(v[k]);
}
k = next[k];
}
} }
int main()
{
int m,n,i,j;
cin>>n;
while(n--)
{
int p,q;
cin>>p>>q;
h = ;
for(i=;i<MAX;i++)
{
first[i] = -;
next[i] = -;
used[i] = ;
in[i] = ;
//out[i] = 0;
}
for(i=;i<=q;i++)
{
int a,b;
scanf("%d %d",&a,&b);
AddEdge(a,b);
AddEdge(b,a);
} int k,flag = ;
k = judge(p); //k为起点
if(k==-)
{
printf("No\n");
continue;
}
//printf("%d\n------------------\n",k);
dfs(k); //从起点开始寻找是否存在欧拉路 /******
for(i=1;i<=h;i++)
{
k = first[i];
while(k!=-1)
{
printf("%d %d %d %d %d\n",u[k],v[k],used[k],first[k],next[k]);
k = next[k];
}
}
*******/ for(i=;i<h;i++)
{
if(used[i]!=) //有边尚未访问 故不能一笔画
{
//printf("kk");
flag = ;
break;
}
}
if(flag==) printf("Yes\n");
else printf("No\n");
}
return ;
}