#include #include #define rep(i,n) for(int i = 0; i < n; i++) #define srep(i,a,b) for(int i = a; i < b; i++) #define all(A) (A).begin(),A.end() #define MOD 1000000007 using namespace std; using ll = long long; using P = pair; using Graph = vector>; int main(void){ int t; cin >> t; rep(i,t){ int n,m; cin >> n >> m; vector C(n); rep(i,m){ int a,b; cin >> a >> b; a--; b--; C[a]++; C[b]++; } map M; rep(i,n) M[C[i]]++; bool ok = 0; for(auto& [k,v] : M) if(v >= 2) ok = 1; cout << (ok ? "Yes" : "No") << endl; } }