#include <bits/stdc++.h>
double gcm(double a, double b) {
  double r = fmod(a, b);
  while (r > 0) {
    a = b;
    b = r;
    r = fmod(a, b);
  }
  return b;
}
int main() {
  int t;
  scanf("%d", &t);
  int i;
  double a, b, c, d;
  for (i = 0; i < t; i++) {
    scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
    if (a < b)
      printf("No\n");
    else if (b > d)
      printf("No\n");
    else {
      if (a >= b && a >= c) {
        a = fmod(a - c, b);
        if (a == b) a -= b;
        a += c;
      }
      if (a - b < 0 && a > c)
        printf("No\n");
      else if (c < b - gcm(b, d))
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
  return 0;
}
