#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A, B, C, D;
  int t, i;
  scanf("%i", &t);
  while (t--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    if (A < B || D < B) {
      printf("No\n");
      continue;
    }
    if (C >= B - 1) {
      printf("Yes\n");
      continue;
    }
    long long X = A % B;
    long long Y = D % B;
    bool ok = 0;
    for (i = 1; i <= 1000000; i++) {
      if (X > C && X < B) {
        ok = 1;
        break;
      }
      if (!Y) break;
      X = B - (B - X) % Y;
      if (X == B) X -= Y;
      if (X > C && X < B) {
        ok = 1;
        break;
      }
      X = X + Y;
      if (X >= B) X -= B;
    }
    if (ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
