// guess #include using namespace std; using ll=long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll t; cin >> t; while(t--){ ll n,m; cin >> n >> m; vector> vp(m); for(ll i=0;i> vp[i].first >> vp[i].second; vp[i].first--; } sort(vp.begin(),vp.end()); vp.push_back({vp[0].first+n,vp[0].second}); bool ok=true; for(ll i=0;iy){ok=false;} } if(ok){cout << "Yes\n";} else{cout << "No\n";} } return 0; }