#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; int a[100001]; int b[200001]; int main(){ int t;cin>>t; rep(i,t){ int n,m;cin>>n>>m; rep(j,m){ int u,v;cin>>u>>v; a[u]++; a[v]++; } rep(j,n+1){ if(b[a[j]]>=1){ cout<<"Yes\n"; goto End; } b[a[j]]++; } cout<<"No\n"; End:; rep(j,100001)a[j]=0; rep(j,200001)b[j]=0; } }