#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    long long int a, b, c, d, j, min, g = 0;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    j = a;
    j -= b;
    if (b < a && b < c && b < d) {
      printf("Yes\n");
      continue;
    }
    if (a < b) {
      printf("No\n");
      continue;
    }
    if (a < c) {
      j += d;
    }
    min = j;
    while (1) {
      if (j > c) {
        j = j % b + (c / b) * b;
        while (j > c) {
          j -= b;
        }
      } else {
        if (j < 0) {
          printf("No\n");
          break;
        }
        if (j < min) {
          min = j;
          g = 0;
        } else if (j == min) {
          if (g != 0) {
            printf("Yes\n");
            break;
          }
          g++;
        }
        j += d - b;
      }
    }
  }
  return 0;
}
