#include using namespace std; int main() { int T; cin >> T; for( int i = 0; i < T; i++ ) { int N, M; cin >> N >> M; vector deg( N ); for( int j = 0; j < M; j++ ) { int u, v; cin >> u >> v; u--; v--; deg[u]++; deg[v]++; } string ans = "No"; set st; for( int j = 0; j < N; j++ ) { if( st.count( deg[j] ) ) { ans = "Yes"; break; } st.insert( deg[j] ); } cout << ans << endl; } }