#include <bits/stdc++.h>
int main(void) {
  int t, i, k, x, y;
  float reft, reftd, r, tmp;
  scanf("%d", &t);
  long long a[300], b[300], c[300], d[300];
  for (i = 1; i <= t; i++) {
    scanf("%d", &a[i]);
    scanf("%d", &b[i]);
    scanf("%d", &c[i]);
    scanf("%d", &d[i]);
  }
  for (i = 1; i <= t - 1; i++) {
    if (a[i] < b[i])
      printf("No\n");
    else if (b[i] > d[i])
      printf("No\n");
    else if (b[i] - 1 <= c[i])
      printf("Yes\n");
    else {
      reft = a[i];
      while (reft >= b[i]) {
        reft = reft - b[i];
      }
      if (reft > c[i])
        printf("No\n");
      else {
        reftd = d[i];
        while (reftd >= b[i]) {
          reftd = reftd - b[i];
        }
        y = reftd;
        x = b[i];
        r = x % y;
        while (r != 0) {
          x = y;
          y = r;
          r = x % y;
        }
        k = 0;
        while (reft >= b[i]) {
          if (c[i] < reft < b[i])
            k++;
          else
            ;
          reft = reft + y;
        }
        if (k >= 1)
          printf("No\n");
        else
          printf("Yes\n");
      }
    }
  }
  return 0;
}
