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