#include <bits/stdc++.h>
int main(void) {
  unsigned long int t, a, b, c, d, i, j, g, z;
  int x[300];
  scanf("%lu", &t);
  for (i = 0; i < t; i++) {
    z = 0;
    scanf("%lu %lu %lu %lu", &a, &b, &c, &d);
    for (j = 0; j < 100000; j++) {
      if (a < b) {
        z = 1;
        break;
      }
      if (a - b <= c)
        g = a - b + d;
      else
        g = a - b;
      a = g;
    }
    x[i] = z;
  }
  for (i = 0; i < t; i++) {
    if (x[i] == 0)
      printf("Yes\n");
    else if (x[i] == 1)
      printf("No\n");
  }
  return 0;
}
