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