#include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin>>t;
while(t--) {
vector<int> v;
int a,b,c,d;
cin>>a>>b>>c>>d;
v.push_back(a); v.push_back(b);
v.push_back(c); v.push_back(d);
sort(v.begin(),v.end());
int f = max(a,b), g = max(c,d);
string flag = "NO";
if(f==v[3] || f==v[2]) {
if(g == v[3] || g==v[2]) {
flag = "YES";
}
}
cout<<flag<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCB0OyBjaW4+PnQ7Cgl3aGlsZSh0LS0pIHsKCQl2ZWN0b3I8aW50PiB2OwoJCWludCBhLGIsYyxkOwoJCWNpbj4+YT4+Yj4+Yz4+ZDsKCQl2LnB1c2hfYmFjayhhKTsgIHYucHVzaF9iYWNrKGIpOwoJCXYucHVzaF9iYWNrKGMpOyAgdi5wdXNoX2JhY2soZCk7CgkJc29ydCh2LmJlZ2luKCksdi5lbmQoKSk7CgkJaW50IGYgPSBtYXgoYSxiKSwgZyA9IG1heChjLGQpOwoJCXN0cmluZyBmbGFnID0gIk5PIjsKCQlpZihmPT12WzNdIHx8IGY9PXZbMl0pIHsKCQkJaWYoZyA9PSB2WzNdIHx8IGc9PXZbMl0pIHsKCQkJCWZsYWcgPSAiWUVTIjsKCQkJfQoJCX0KCQljb3V0PDxmbGFnPDxlbmRsOwoJfQoJcmV0dXJuIDA7Cn0=