#include #define int long long #define fr first #define sc second using namespace std; int const N=1e6+5; typedef pair pii; int n,m,sum,cnt,t,ans,h,w,k; signed main() { // freopen(".in","r",stdin); // freopen(".out","w",stdout); ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>t; while(t--) { cin>>h>>w>>n>>k; if(h==1||w==1) { if(k==1) cout<<"NO\n"; else cout<<"YES\n"; continue; } cout<<"YES\n"; } return 0; }