#define _GLIBCXX_DEBUG #include using namespace std; int main() { int T; cin >> T; for(int i = 0; i < T; i++){ int N, M; cin >> N >> M; vector S(N+1,0); S[0] = 1000000000; for(int j = 0; j < M; j++){ int V1, V2; cin >> V1 >> V2; S[V1]++, S[V2]++; } sort(S.begin(), S.end()); for(int j = 0; j < N; j++){ if(S[j] == 1000000000){ cout << "No" << endl; } if(S[j] == S[j+1]){ cout << "Yes" << endl; break; } } } }