#include <bits/stdc++.h>
const double EPS = 1e-9;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
pair<double, double> add(pair<double, double> a, pair<double, double> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<double, double> sub(pair<double, double> a, pair<double, double> b) {
  return {a.first - b.first, a.second - b.second};
}
double dist(pair<double, double> a, pair<double, double> b) {
  return ((a.first - b.first) * (a.first - b.first) +
          (a.second - b.second) * (a.second - b.second));
}
double rdist(pair<double, double> a, pair<double, double> b) {
  return sqrt((a.first - b.first) * (a.first - b.first) +
              (a.second - b.second) * (a.second - b.second));
}
double distPS(pair<double, double> a,
              pair<pair<double, double>, pair<double, double> > b) {
  double AB = rdist(a, b.first);
  double AC = rdist(a, b.second);
  double BC = rdist(b.first, b.second);
  double s = AB + AC + BC;
  s /= 2.0;
  return 2 * sqrt(s * (s - AB) * (s - BC) * (s - AC)) / BC;
}
double dabs(double a) {
  if (a + EPS > 0) return a;
  return -a;
}
double dotProduct(pair<double, double> a, pair<double, double> b) {
  return a.first * b.first + a.second * b.second;
}
double crossProduct(pair<double, double> a, pair<double, double> b) {
  return a.first * b.second - a.second * b.first;
}
int ccw(pair<double, double> a, pair<double, double> b,
        pair<double, double> c) {
  double tmp = crossProduct(sub(b, a), sub(c, a));
  if (tmp > EPS) {
    return -1;
  } else if (tmp < -EPS) {
    return 1;
  } else {
    return 0;
  }
}
pair<double, double> intLiLi(pair<double, double> a, pair<double, double> b,
                             pair<double, double> c, pair<double, double> d) {
  return make_pair(
      ((a.first * b.second - b.first * a.second) * (c.first - d.first) -
       (a.first - b.first) * (c.first * d.second - d.first - c.second)) /
          ((a.first - b.first) * (c.second - d.second) -
           (a.second - b.second) * (c.first - d.first)),
      ((a.first * b.second - b.first * a.second) * (c.second - d.second) -
       (a.second - b.second) * (c.first * d.second - d.first * c.second)) /
          ((a.first - b.first) * (c.second - d.second) -
           (a.second - b.second) * (c.first - d.first)));
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No" << '\n';
      continue;
    }
    if (a < b) {
      cout << "No" << '\n';
      continue;
    }
    if (b <= c + 1) {
      cout << "Yes" << '\n';
      continue;
    }
    set<long long> S;
    long long now = a;
    bool oke = 1;
    int cnt = 0;
    while (S.count(now) == 0) {
      S.insert(now);
      if (now < b) {
        cout << "No" << '\n';
        oke = 0;
        break;
      }
      now %= b;
      if (now <= c) {
        now += d;
      }
      cnt++;
      if (cnt > 100000) {
        break;
      }
    }
    if (oke) cout << "Yes" << '\n';
  }
  return 0;
}
