/* Rohan Balot NSIT, New Delhi */ #include using namespace std; #define ALL(t) (t).begin(), (t).end() #define mp make_pair #define show(t) copy((t).begin(), (t).end(), ostream_iterator(cout, ' ')) const int N = 77778; const int M = 77778; void __answer() { int n; cin >> n; set s; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; s.insert(abs(x)); s.insert(abs(y)); } if(s.size() == 2) cout << "YES\n"; else cout << "NO\n"; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifdef LOCAL freopen("sample_input.txt","r",stdin); #endif size_t _t; cin >> _t; cin.ignore(); while (_t--) { __answer(); } return 0; }