#include <bits/stdc++.h>
using namespace std;
int main() {
  int tcase;
  long long A, B, C, D;
  scanf("%d", &tcase);
  while (tcase--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (B > A)
      puts("No");
    else if ((A % B > C || B > D))
      puts("No");
    else {
      if (B == D)
        puts("Yes");
      else {
        long long st = A % B, limt = B - 1;
        if ((D - B) > limt - st)
          puts("Yes");
        else {
          long long pos = st + (limt - st) / (D - B) * (D - B);
          if (C < pos && pos < B)
            puts("No");
          else
            puts("Yes");
        }
      }
    }
  }
  return 0;
}
