#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <assert.h>

using namespace std;

#define ll long long

ll gcd(ll a, ll b, ll &x, ll &y)
{
	if (b == 0)
	{
		x = 1;
		y = 0;
		return a;
	}
	ll x0, y0;
	ll res = gcd(b, a%b, x0, y0);

	x = y0;
	y = x0 - (a / b) * y0;

	return res;
}

bool solve(ll a, ll b, ll c)
{
	ll x, y;
	ll d = gcd(a, b, x, y);

	if (c%d != 0) return false;
	
	x *= c/d;
	y *= c/d;
	assert(a*x + b*y == c);

	// aX + bY == c, X=x+bt, Y=y-at
	
	ll l, r;

	r = y/a;
	l = -x/b;
	if (x%b) l++;
	
	if (l<=r) return true;
	return false;
}

int main()
{
	freopen("hotel.in", "r", stdin);
	//freopen("hotel.out", "w", stdout);

	int test;
	cin >> test;

	for(int tt=0; tt<test; tt++)
	{
		ll w, h, th, tw;

		cin >> tw >> th >> w >> h;

		if (w % tw == 0 && h % th == 0)
		{
			cout << "YES" << endl;
			continue;
		}

		if (h % tw == 0 && w % th == 0)
		{
			cout << "YES" << endl;
			continue;
		}

		if (h % tw == 0 && h % th == 0 && solve(tw, th, w))
		{
			cout << "YES" << endl;
			continue;
		}

		if (w % tw == 0 && w % th == 0 && solve(tw, th, h))
		{
			cout << "YES" << endl;
			continue;
		}

		cout << "NO" << endl;
	}

	return 0;
}