# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, q, last, cnt, sum[2000000], ans, dp[5000][5000], a[2000000], b[2000000];
string str;
bool f;
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ -1,0 } ,{ 0,-1 } };
struct Edge { LL from, cost; };
vector<Edge>vec[1000000];
vector<Pll>v;
map<string, LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
LL gcd(LL x, LL y)
{
	LL r;
	// ユーグリッドの互除法
	while ((r = x % y) != 0)  // yで割り切れるまでループ
	{
		x = y;
		y = r;
	}
	return y;
}
int main() {
	cin >> n;
	rep(i, n) {
		LL x, y, z, w;
		cin >> x >> y >> z >> w;
		if (x < y)cout << "No" << endl;
		else {
			LL A[5];
			A[0] = gcd(x, y), A[1] = gcd(z, w), A[2] = gcd(y, z);
			A[0] = gcd(A[0], A[1]);
			A[0] = gcd(A[0], A[2]);
			x /= A[0], y /= A[0], z /= A[0], w /= A[0];
			if (y > w)cout << "No" << endl;
			else {
				if (y - 1 <= z)
					cout << "Yes" << endl;
				else {
					x %= y;
					if (x > z)
						cout << "No" << endl;
					else {
						if (x <= z && y == w)
							cout << "Yes" << endl;
						else {
							A[4] = w - y;
							if (y / A[4] * A[4] - x / A[4] * A[4] +x > z
								&&y / A[4] * A[4] - x / A[4] * A[4] +x < y)
								cout << "No" << endl;
							else if (y / A[4] * (A[4]) - x/A[4]*A[4]-A[4]+x > z)
								cout << "No" << endl;
							else
								cout << "Yes" << endl;
						}
					}
				}
			}
		}
	}
	return 0;
}
