#include <bits/stdc++.h>
int gcm(long long int x, long long int y) {
  int r, tmp;
  if (x < y) {
    tmp = x;
    x = y;
    y = tmp;
  }
  r = x % y;
  while (r != 0) {
    x = y;
    y = r;
    r = x % y;
  }
  return (y);
}
int main() {
  int T;
  scanf("%d", &T);
  int q, i;
  long long int A[T], B[T], C[T], D[T];
  long long int a, b, c, d, gcm_bd;
  for (q = 0; q < T; q++) {
    scanf("%lld %lld %lld %lld", &A[q], &B[q], &C[q], &D[q]);
  }
  for (q = 0; q < T; q++) {
    a = A[q];
    b = B[q];
    c = C[q];
    d = D[q];
    if (a < b || d < b) {
      printf("No\n");
    } else if (c >= b - 1) {
      printf("Yes\n");
    } else {
      a = a % b;
      gcm_bd = gcm(b, d);
      a = b - gcm_bd + (a % gcm_bd);
      if (a > c) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
    }
  }
  return 0;
}
