#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9 + 10;
const long long linf = (long long)1e18 + 10;
const long long mod = (long long)(1e9 + 7);
const long long dx[] = {0, 1, 0, -1};
const long long dy[] = {1, 0, -1, 0};
const long long ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;
long long mop(long long a, long long b, long long m = mod) {
  long long r = 1;
  a %= m;
  for (; b; b >>= 1) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
  }
  return r;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
bool ool(long long x, long long y, long long h, long long w) {
  return ((x < 0) || (h <= x) || (y < 0) || (w <= y));
}
bool deq(double a, double b) { return abs(a - b) < eps; }
struct oreno_initializer {
  oreno_initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
} oreno_initializer;
long long q, a, b, c, d;
signed main() {
  cin >> q;
  while (q--) {
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << '\n';
      continue;
    }
    long long k = max((a - c + b - 1) / b, 1ll);
    a -= b * k;
    if (a < 0) {
      cout << "No" << '\n';
      continue;
    }
    long long p = d % b;
    if (p == 0) {
      cout << "Yes" << '\n';
      continue;
    }
    k = (b + p - 1) / p;
    k = p * k % b;
    long long t = (c - a + p - 1) / p;
    if ((c - a) % p == 0) t++;
    t = a + t * p;
    if ((k == 0 && c < t % b) || (k != 0 && k <= b - c - 1))
      cout << "No" << '\n';
    else
      cout << "Yes" << '\n';
  }
}
