#include <bits/stdc++.h>
using namespace std;
long long Gcd(long long a, long long b) {
  long long tmp;
  if (a > b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while ((b %= a)) {
    tmp = a;
    a = b;
    b = tmp;
  }
  return a;
}
int main() {
  long long a, b, c, d, t, distance, gcd, max, r;
  bool flag = 1;
  cin >> t;
  for (int i = 0; i < t; i++) {
    flag = 1;
    cin >> a >> b >> c >> d;
    if (a < b || d < b || a % b > c)
      flag = 0;
    else if (d > b && c + 1 < b) {
      distance = d - b;
      gcd = Gcd(c, Gcd(distance, b));
      r = a % gcd;
      for (max = r; max + distance < b; max += gcd) continue;
      max -= gcd;
      if (max + distance > c) flag = 0;
    }
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
