#include #pragma GCC optimize ("Ofast") using namespace std; #define rep(i,a,b) for(ll i = a; i vl; typedef pair pll; int main(){ cin.tie(0); ios_base::sync_with_stdio(0); int t; cin >> t; while(t--) { int n; cin >> n; priority_queue dists; for(int i = 0; i < n; i++) { int a, b; cin >> a >> b; dists.push(a+b); } vector remaining; while(dists.size()) { int a = dists.top(); dists.pop(); if(dists.size() && dists.top() == a) { dists.pop(); dists.push(a-1); } else { remaining.push_back(a); } } if(remaining.size() >= 2 && remaining.back() == -1 && remaining[remaining.size()-2] == 0) cout << "NO\n"; else cout << "YES\n"; } }