#include <bits/stdc++.h>
int compare_long(const void *p, const void *q) {
  return *(long *)p - *(long *)q;
}
int main() {
  int i, N;
  int flg;
  int count = 0;
  long A, B, C, D;
  long AB[1000000] = {};
  long noon, night;
  long *ptr;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%ld %ld %ld %ld", &A, &B, &C, &D);
    night = A;
    count = 0;
    memset(AB, 0, sizeof(AB));
    while (1) {
      noon = night - B;
      if (noon < 0) {
        flg = 1;
        break;
      }
      ptr = (long *)bsearch(&noon, AB, count, sizeof(long), compare_long);
      if (ptr == NULL) {
        AB[count++] = noon;
        qsort(AB, count, sizeof(long), compare_long);
        if (noon <= C) {
          night = noon + D;
        } else {
          night = noon;
        }
      } else {
        flg = 0;
        break;
      }
    }
    if (flg == 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
