#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 || B > D)
      puts("No");
    else if (C >= B)
      puts("Yes");
    else {
      long long last = A - (A - C - 1) / B * B - B;
      if (last < 0)
        puts("No");
      else if (D == B)
        puts("Yes");
      else {
        long long pos = last + (B - 1 - last) / (D - B) * (D - B);
        if (C < pos && pos < B)
          puts("No");
        else
          puts("Yes");
      }
    }
  }
  return 0;
}
