#include <bits/stdc++.h>
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 0; i < T; i++) {
    printf("%d ", i);
    long int A, B, C, D;
    scanf("%ld", &A);
    scanf("%ld", &B);
    scanf("%ld", &C);
    scanf("%ld", &D);
    if (A < B) {
      printf("No\n");
      continue;
    } else {
      if (B > D) {
        printf("No\n");
        continue;
      } else {
        if (C >= B - 1) {
          printf("Yes\n");
          continue;
        } else {
          long a = A % B;
          long d = D % B;
          if (a > C) {
            printf("Yes\n");
            continue;
          } else {
            int c = 0;
            for (int k = C + 1; k < B; k++) {
              if ((k - a) % d == 0) c = 1;
            }
            if (c == 1) {
              printf("No\n");
              continue;
            } else {
              printf("Yes\n");
              continue;
            }
          }
        }
      }
    }
  }
  return 0;
}
